Skip to content

Commit

Permalink
add column comment to get_columns method
Browse files Browse the repository at this point in the history
  • Loading branch information
dotan-mor committed Sep 9, 2024
1 parent 726b05d commit ef4ff2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlalchemy_cockroachdb/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get_columns(self, conn, table_name, schema=None, **kw):
"SELECT column_name, data_type, is_nullable::bool, column_default,"
"numeric_precision, numeric_scale, character_maximum_length, "
"NULL AS is_generated, NULL AS generation_expression, is_hidden::bool,"
"comment "
"column_comment AS comment "
"FROM information_schema.columns "
"WHERE table_schema = :table_schema AND table_name = :table_name "
)
Expand All @@ -201,7 +201,7 @@ def get_columns(self, conn, table_name, schema=None, **kw):
"numeric_precision, numeric_scale, character_maximum_length, "
"CASE is_generated WHEN 'ALWAYS' THEN true WHEN 'NEVER' THEN false "
"ELSE is_generated::bool END AS is_generated, "
"generation_expression, is_hidden::bool, crdb_sql_type, comment "
"generation_expression, is_hidden::bool, crdb_sql_type, column_comment AS comment "
"FROM information_schema.columns "
"WHERE table_schema = :table_schema AND table_name = :table_name "
)
Expand Down

0 comments on commit ef4ff2d

Please sign in to comment.