fix: add auto-increment field detection in smart-query import (#935)

This commit is contained in:
Jonathan Fishner
2025-09-28 17:09:02 +03:00
committed by GitHub
parent bb033091b1
commit 57b3b8777f
8 changed files with 45 additions and 7 deletions

View File

@@ -194,7 +194,12 @@ cols AS (
',"default":"', ${withExtras ? withDefault : withoutDefault},
'","collation":"', COALESCE(cols.COLLATION_NAME, ''),
'","comment":"', ${withExtras ? withComments : withoutComments},
'"}')), ',') AS cols_metadata
'","is_identity":', CASE
WHEN cols.is_identity = 'YES' THEN 'true'
WHEN cols.column_default IS NOT NULL AND cols.column_default LIKE 'nextval(%' THEN 'true'
ELSE 'false'
END,
'}')), ',') AS cols_metadata
FROM information_schema.columns cols
LEFT JOIN pg_catalog.pg_class c
ON c.relname = cols.table_name