mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 03:16:01 +00:00
create script callable from react
This commit is contained in:
@@ -11,9 +11,10 @@ const dialect = {
|
||||
|
||||
/** @type {import('@dbgate/types').EngineDriver} */
|
||||
const driver = {
|
||||
async connect({pg}, { server, port, user, password, database }) {
|
||||
const client = new pg.Client({ host: server, port, user, password, database: database || 'postgres' });
|
||||
async connect(nativeModules, { server, port, user, password, database }) {
|
||||
const client = new nativeModules.pg.Client({ host: server, port, user, password, database: database || 'postgres' });
|
||||
await client.connect();
|
||||
client._nativeModules = nativeModules;
|
||||
return client;
|
||||
},
|
||||
async query(client, sql) {
|
||||
|
||||
Reference in New Issue
Block a user