postgre analyser

This commit is contained in:
Jan Prochazka
2020-06-29 19:49:54 +02:00
parent eaaa7beaa1
commit 3c1be39976
6 changed files with 35 additions and 13 deletions

View File

@@ -2,10 +2,12 @@ const columns = require('./columns');
const tableModifications = require('./tableModifications');
const primaryKeys = require('./primaryKeys');
const foreignKeys = require('./foreignKeys');
const views = require('./views');
module.exports = {
columns,
tableModifications,
primaryKeys,
foreignKeys,
views,
};

View File

@@ -20,7 +20,7 @@ SELECT oid as "objectId", nspname as "schemaName", relname as "pureName",
' ' || column_name || ' ' || type || ' '|| not_null
)
, E',\\n'
) || E'\\n);\\n' || (select pkey from pkey where pkey.conrelid = oid)) as "hash"
) || E'\\n);\\n' || (select pkey from pkey where pkey.conrelid = oid)) as "hashCode"
from
(
SELECT

View File

@@ -0,0 +1,9 @@
module.exports = `
select
table_name as "pureName",
table_schema as "schemaName",
view_definition as "createSql",
md5(view_definition) as "hashCode"
from
information_schema.views where table_schema != 'information_schema' and table_schema != 'pg_catalog'
`;