diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-08-03 21:19:32 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-08-03 21:19:32 +0000 |
commit | edf6b16fae38b4c103ed2827ee5448fec2fdcb1a (patch) | |
tree | 2d02c785663acab948e3ab8cf65e50ba738e60b6 /lib/sqlalchemy/databases/firebird.py | |
parent | 8df49e7194f272573f043343e601c4ee4beb0f70 (diff) | |
download | sqlalchemy-edf6b16fae38b4c103ed2827ee5448fec2fdcb1a.tar.gz |
- compiler visit_label() checks a flag "within_order_by" and will render its own name
and not its contained expression, if the dialect reports true for supports_simple_order_by_label.
the flag is not propagated forwards, meant to closely mimic the syntax Postgres expects which is
that only a simple name can be in the ORDER BY, not a more complex expression or function call
with the label name embedded (mysql and sqlite support more complex expressions).
This further sets the standard for propigation of **kwargs within compiler, that we can't just send
**kwargs along blindly to each XXX.process() call; whenever a **kwarg needs to propagate through,
most methods will have to be aware of it and know when they should send it on forward and when not.
This was actually already the case with result_map as well.
The supports_simple_order_by dialect flag defaults to True but is conservatively explicitly set to
False on all dialects except SQLite/MySQL/Postgres to start.
[ticket:1068]
Diffstat (limited to 'lib/sqlalchemy/databases/firebird.py')
-rw-r--r-- | lib/sqlalchemy/databases/firebird.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/databases/firebird.py b/lib/sqlalchemy/databases/firebird.py index 33ae4feab..412f7bce6 100644 --- a/lib/sqlalchemy/databases/firebird.py +++ b/lib/sqlalchemy/databases/firebird.py @@ -310,6 +310,7 @@ class FBDialect(default.DefaultDialect): max_identifier_length = 31 preexecute_pk_sequences = True supports_pk_autoincrement = False + supports_simple_order_by_label = False def __init__(self, type_conv=200, concurrency_level=1, **kwargs): default.DefaultDialect.__init__(self, **kwargs) @@ -675,7 +676,7 @@ class FBCompiler(sql.compiler.DefaultCompiler): yield co else: yield c - columns = [self.process(c, render_labels=True) + columns = [self.process(c, within_columns_clause=True) for c in flatten_columnlist(returning_cols)] text += ' RETURNING ' + ', '.join(columns) return text |