diff options
author | Mark Sandan <msandan@utexas.edu> | 2016-05-18 18:31:14 -0700 |
---|---|---|
committer | Mark Sandan <msandan@utexas.edu> | 2016-05-18 18:31:14 -0700 |
commit | 3fca9add682a9fe97e4e5b5b8011507c878866e0 (patch) | |
tree | 99c5da99f9bac808501c62ac1f8cf456cd73164a /lib/sqlalchemy/sql/compiler.py | |
parent | c124fa36d5af2c85c87c51d24e92387adffbe3d2 (diff) | |
download | sqlalchemy-3fca9add682a9fe97e4e5b5b8011507c878866e0.tar.gz |
Add table_options function to use with visit_create_table
Hi, I'm implementing a dialect for sqlalchemy and would like to add options to my CREATE TABLE DDL before the '(' but after the table name in visit_create_table. I know I can just subclass visit_create in my ddl compiler but it seems kind of silly since I'd be making a small change.
table_options would be a function in the ddl compiler provided by the dialect that takes dialect specific keywords and simply appends comma delimited values.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 3d2f02006..3567427a7 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2216,7 +2216,7 @@ class DDLCompiler(Compiled): text = "\nCREATE " if table._prefixes: text += " ".join(table._prefixes) + " " - text += "TABLE " + preparer.format_table(table) + " (" + text += "TABLE " + preparer.format_table(table) + " " + self.table_options(table) + " (" separator = "\n" @@ -2421,6 +2421,9 @@ class DDLCompiler(Compiled): colspec += " NOT NULL" return colspec + def table_options(self, table): + return '' + def post_create_table(self, table): return '' |