diff options
author | Frazer McLean <frazer@frazermclean.co.uk> | 2016-06-13 10:31:18 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-06-13 10:31:18 -0400 |
commit | 84974cf09220105bc7a92e5bcde31f52827c1de7 (patch) | |
tree | 250677d68a0c6ba0070a97cd6cd3a7c2c2949c50 /lib/sqlalchemy/engine/reflection.py | |
parent | 7189d0bc82598c2d6dcbb55b054837416db2ee7d (diff) | |
download | sqlalchemy-pr_github_284.tar.gz |
Comment supportpr_github_284
Implementation of [#1546 (BitBucket)](https://bitbucket.org/zzzeek/sqlalchemy/issues/1546).
Very unfinished but I have reflection and setting after table creation working for PostgreSQL.
If you're not opposed, perhaps best to continue discussion on Gerrit?
Change-Id: Ib90683850805a2b4ee198e420dc294f32f15d35d
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/284
Diffstat (limited to 'lib/sqlalchemy/engine/reflection.py')
-rw-r--r-- | lib/sqlalchemy/engine/reflection.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index 14e98cecf..722b4f786 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -506,6 +506,10 @@ class Inspector(object): return self.dialect.get_unique_constraints( self.bind, table_name, schema, info_cache=self.info_cache, **kw) + def get_table_comment(self, table_name, schema=None, **kw): + return self.dialect.get_table_comment( + self.bind, table_name, schema, info_cache=self.info_cache, **kw) + def get_check_constraints(self, table_name, schema=None, **kw): """Return information about check constraints in `table_name`. @@ -616,6 +620,8 @@ class Inspector(object): table_name, schema, table, cols_by_orig_name, include_columns, exclude_columns, reflection_options) + table.comment = self.get_table_comment(table_name, schema) + def _reflect_column( self, table, col_d, include_columns, exclude_columns, cols_by_orig_name): @@ -635,7 +641,7 @@ class Inspector(object): col_kw = dict( (k, col_d[k]) - for k in ['nullable', 'autoincrement', 'quote', 'info', 'key'] + for k in ['nullable', 'autoincrement', 'quote', 'info', 'key', 'comment'] if k in col_d ) |