diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-18 21:37:48 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-08-18 21:37:48 +0000 |
commit | 7c6c1b99c2de00829b6f34ffba7e3bb689d34198 (patch) | |
tree | acd6f8dc84cea86fc58b195a5f1068cbe020e955 /lib/sqlalchemy/databases/access.py | |
parent | 534cf5fdbd05e2049ab9feceabf3926a5ab6380c (diff) | |
download | sqlalchemy-7c6c1b99c2de00829b6f34ffba7e3bb689d34198.tar.gz |
1. Module layout. sql.py and related move into a package called "sql".
2. compiler names changed to be less verbose, unused classes removed.
3. Methods on Dialect which return compilers, schema generators, identifier preparers
have changed to direct class references, typically on the Dialect class itself
or optionally as attributes on an individual Dialect instance if conditional behavior is needed.
This takes away the need for Dialect subclasses to know how to instantiate these
objects, and also reduces method overhead by one call for each one.
4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now). The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument.
5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
Diffstat (limited to 'lib/sqlalchemy/databases/access.py')
-rw-r--r-- | lib/sqlalchemy/databases/access.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/databases/access.py b/lib/sqlalchemy/databases/access.py index 6bf8b96e9..4aa773239 100644 --- a/lib/sqlalchemy/databases/access.py +++ b/lib/sqlalchemy/databases/access.py @@ -347,7 +347,7 @@ class AccessDialect(ansisql.ANSIDialect): return names -class AccessCompiler(ansisql.ANSICompiler): +class AccessCompiler(compiler.DefaultCompiler): def visit_select_precolumns(self, select): """Access puts TOP, it's version of LIMIT here """ s = select.distinct and "DISTINCT " or "" @@ -387,7 +387,7 @@ class AccessCompiler(ansisql.ANSICompiler): return '' -class AccessSchemaGenerator(ansisql.ANSISchemaGenerator): +class AccessSchemaGenerator(compiler.SchemaGenerator): def get_column_specification(self, column, **kwargs): colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect).get_col_spec() @@ -410,7 +410,7 @@ class AccessSchemaGenerator(ansisql.ANSISchemaGenerator): return colspec -class AccessSchemaDropper(ansisql.ANSISchemaDropper): +class AccessSchemaDropper(compiler.SchemaDropper): def visit_index(self, index): self.append("\nDROP INDEX [%s].[%s]" % (index.table.name, index.name)) self.execute() @@ -418,7 +418,7 @@ class AccessSchemaDropper(ansisql.ANSISchemaDropper): class AccessDefaultRunner(ansisql.ANSIDefaultRunner): pass -class AccessIdentifierPreparer(ansisql.ANSIIdentifierPreparer): +class AccessIdentifierPreparer(compiler.IdentifierPreparer): def __init__(self, dialect): super(AccessIdentifierPreparer, self).__init__(dialect, initial_quote='[', final_quote=']') |