From 3f8914b4b28f309467b96f2903388e69cf8c2b2d Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Sun, 9 Nov 2008 05:21:38 +0000 Subject: 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. --- lib/sqlalchemy/databases/access.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/databases/access.py b/lib/sqlalchemy/databases/access.py index 425c1eb69..113827185 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): -- cgit v1.2.1