From: Michael Trier Date: Sun, 9 Nov 2008 05:21:38 +0000 (+0000) Subject: Corrected problems with Access dialect. Corrected issue with reflection due to missin... X-Git-Tag: rel_0_5rc4~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f8914b4b28f309467b96f2903388e69cf8c2b2d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Corrected problems with Access dialect. Corrected issue with reflection due to missing Currency type. Functions didn't return the value. JOINS must be specified as LEFT OUTER JOIN or INNER JOIN. Fixes #1017. --- diff --git a/CHANGES b/CHANGES index 7aa77e89eb..41f509c5f4 100644 --- a/CHANGES +++ b/CHANGES @@ -8,13 +8,22 @@ CHANGES ======== - bugfixes and behavioral changes - general: - - global "propigate"->"propagate" change. + - global "propigate"->"propagate" change. - orm - Query.count() and Query.get() return a more informative error message when executed against multiple entities. [ticket:1220] +- access + - Added support for Currency type. + + - Functions were not return their result. [ticket:1017] + + - Corrected problem with joins. Access only support + LEFT OUTER or INNER not just JOIN by itself. + [ticket:1017] + - mssql - Lots of cleanup and fixes to correct problems with limit and offset. @@ -51,7 +60,7 @@ CHANGES create_engine() to adjust how many characters max will be present in dynamically generated column labels, i.e. "somecolumn AS somelabel". Any value less than 6 will - result in a label of minimal size, consiting of an + result in a label of minimal size, consisting of an underscore and a numeric counter. The compiler uses the value of dialect.max_identifier_length as a default. [ticket:1211] @@ -318,14 +327,14 @@ CHANGES - Joins along a relation() from a mapped class to a mapped subclass, where the mapped subclass is configured with single table inheritance, will include an IN clause which limits the - subtypes of the joined class to those requsted, within the ON + subtypes of the joined class to those requested, within the ON clause of the join. This takes effect for eager load joins as well as query.join(). Note that in some scenarios the IN clause will appear in the WHERE clause of the query as well since this discrimination has multiple trigger points. - AttributeExtension has been refined such that the event - is fired before the mutation actually occurs. Addtionally, + is fired before the mutation actually occurs. Additionally, the append() and set() methods must now return the given value, which is used as the value to be used in the mutation operation. This allows creation of validating AttributeListeners which @@ -373,7 +382,7 @@ CHANGES joined-table inheritance subclasses, using explicit join criteria (i.e. not on a relation). - - @orm.attributes.on_reconsitute and + - @orm.attributes.on_reconstitute and MapperExtension.on_reconstitute have been renamed to @orm.reconstructor and MapperExtension.reconstruct_instance @@ -499,7 +508,7 @@ CHANGES - fixed endless loop bug which could occur within a mapper's deferred load of inherited attributes. - - a legacy-support flag "_enable_transation_accounting" flag + - a legacy-support flag "_enable_transaction_accounting" flag added to Session which when False, disables all transaction-level object accounting, including expire on rollback, expire on commit, new/deleted list maintenance, and diff --git a/lib/sqlalchemy/databases/access.py b/lib/sqlalchemy/databases/access.py index 425c1eb69c..1138271858 100644 --- a/lib/sqlalchemy/databases/access.py +++ b/lib/sqlalchemy/databases/access.py @@ -252,6 +252,7 @@ class AccessDialect(default.DefaultDialect): const.dbMemo: AcText, const.dbBoolean: AcBoolean, const.dbText: AcUnicode, # All Access strings are unicode + const.dbCurrency: AcNumeric, } # A fresh DAO connection is opened for each reflection @@ -360,7 +361,7 @@ class AccessCompiler(compiler.DefaultCompiler): def visit_function(self, func): """Access function names differ from the ANSI SQL names; rewrite common ones""" func.name = self.function_rewrites.get(func.name, func.name) - super(AccessCompiler, self).visit_function(func) + return super(AccessCompiler, self).visit_function(func) def for_update_clause(self, select): """FOR UPDATE is not supported by Access; silently ignore""" @@ -373,6 +374,10 @@ class AccessCompiler(compiler.DefaultCompiler): else: return "" + def visit_join(self, join, asfrom=False, **kwargs): + return (self.process(join.left, asfrom=True) + (join.isouter and " LEFT OUTER JOIN " or " INNER JOIN ") + \ + self.process(join.right, asfrom=True) + " ON " + self.process(join.onclause)) + class AccessSchemaGenerator(compiler.SchemaGenerator): def get_column_specification(self, column, **kwargs):