mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 09:05:59 +00:00
schemaList moved from dbinfo to separate request
This commit is contained in:
@@ -4,7 +4,7 @@ const stream = require('stream');
|
||||
const driverBases = require('../frontend/drivers');
|
||||
const Analyser = require('./Analyser');
|
||||
const pg = require('pg');
|
||||
const { getLogger, createBulkInsertStreamBase, makeUniqueColumnNames } = global.DBGATE_PACKAGES['dbgate-tools'];;
|
||||
const { getLogger, createBulkInsertStreamBase, makeUniqueColumnNames } = global.DBGATE_PACKAGES['dbgate-tools'];
|
||||
|
||||
const logger = getLogger('postreDriver');
|
||||
|
||||
@@ -267,6 +267,20 @@ const drivers = driverBases.map(driverBase => ({
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
async listSchemas(pool) {
|
||||
const schemaRows = await this.query(
|
||||
pool,
|
||||
'select oid as "object_id", nspname as "schema_name" from pg_catalog.pg_namespace'
|
||||
);
|
||||
|
||||
const schemas = schemaRows.rows.map(x => ({
|
||||
schemaName: x.schema_name,
|
||||
objectId: x.object_id,
|
||||
}));
|
||||
|
||||
return schemas;
|
||||
},
|
||||
}));
|
||||
|
||||
module.exports = drivers;
|
||||
|
||||
Reference in New Issue
Block a user