mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 20:46:01 +00:00
postgre analyser
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
9
packages/engines/postgres/sql/views.js
Normal file
9
packages/engines/postgres/sql/views.js
Normal 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'
|
||||
`;
|
||||
Reference in New Issue
Block a user