Database diagrams editor that allows you to visualize and design your DB with a single query.
TypeScript databasedbdb-migrationeditorerdmariadbmssqlmysqlpostgresqlreactreact-flowschema-migrationssqlsqlitetypescriptvisualizationxyflow
fix pg import query for comments cols+tbls (#288)
Jonathan Fishner637bfe9611f9
diff --git a/src/lib/data/import-metadata/scripts/postgres-script.ts b/src/lib/data/import-metadata/scripts/postgres-script.tsindex a7c8dc1f..a8f6b893 100644--- a/src/lib/data/import-metadata/scripts/postgres-script.ts+++ b/src/lib/data/import-metadata/scripts/postgres-script.ts@@ -161,7 +161,8 @@ cols AS (',"nullable":', CASE WHEN (cols.IS_NULLABLE = 'YES') THEN 'true' ELSE 'false' END,',"default":"', COALESCE(replace(replace(cols.column_default, '"', '\\"'), '\\x', '\\\\x'), ''),'","collation":"', COALESCE(cols.COLLATION_NAME, ''),- '","comment":"', COALESCE(dsc.description, ''), '"}')), ',') AS cols_metadata+ '","comment":"', COALESCE(replace(replace(dsc.description, '"', '\\"'), '\\x', '\\\\x'), ''),+ '"}')), ',') AS cols_metadataFROM information_schema.columns colsLEFT JOIN pg_catalog.pg_class cON c.relname = cols.table_name@@ -204,7 +205,8 @@ cols AS (FROM pg_stat_user_tables sWHERE tbls.TABLE_SCHEMA = s.schemaname AND tbls.TABLE_NAME = s.relname),0), ', "type":"', tbls.TABLE_TYPE, '",', '"engine":"",', '"collation":"",',- '"comment":"', COALESCE(dsc.description, ''), '"}'+ '"comment":"', COALESCE(replace(replace(dsc.description, '"', '\\"'), '\\x', '\\\\x'), ''),+ '"}')),',') AS tbls_metadataFROM information_schema.tables tbls