This commit is contained in:
Jan Prochazka 2024-09-19 14:17:11 +02:00
parent b30f139b5d
commit 66b39c1f80
2 changed files with 4 additions and 3 deletions

View File

@ -70,7 +70,7 @@ describe('Schema tests', () => {
await driver.query(schemaConn, `create table myschema.myt1 (id int not null primary key)`);
const structure1 = await driver.analyseFull(schemaConn);
expect(structure1.tables.length).toEqual(1);
expect(structure1.tables[0].tableName).toEqual('myt1');
expect(structure1.tables[0].pureName).toEqual('myt1');
})
);
});

View File

@ -4,7 +4,8 @@ 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, extractDbNameFromComposite } =
global.DBGATE_PACKAGES['dbgate-tools'];
const logger = getLogger('postreDriver');
@ -76,7 +77,7 @@ const drivers = driverBases.map(driverBase => ({
port: authType == 'socket' ? null : port,
user,
password,
database: database || 'postgres',
database: extractDbNameFromComposite(database) || 'postgres',
ssl,
application_name: 'DbGate',
};