mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 05:46:01 +00:00
optimalization
This commit is contained in:
@@ -134,16 +134,8 @@ const drivers = driverBases.map(driverBase => ({
|
|||||||
database,
|
database,
|
||||||
};
|
};
|
||||||
|
|
||||||
const datatypes = await this.query(
|
const datatypes = await this.query(dbhan, `SELECT oid, typname FROM pg_type WHERE typname in ('geography')`);
|
||||||
dbhan,
|
const typeIdToName = _.fromPairs(datatypes.rows.map(cur => [cur.oid, cur.typname]));
|
||||||
`SELECT oid AS datatypeid, typname AS datatypename FROM pg_type WHERE typname in ('geography')`
|
|
||||||
);
|
|
||||||
|
|
||||||
const typeIdToName = datatypes.rows.reduce((acc, cur) => {
|
|
||||||
acc[cur.datatypeid] = cur.datatypename;
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
dbhan['typeIdToName'] = typeIdToName;
|
dbhan['typeIdToName'] = typeIdToName;
|
||||||
|
|
||||||
if (isReadOnly) {
|
if (isReadOnly) {
|
||||||
|
|||||||
Reference in New Issue
Block a user