mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 02:36:00 +00:00
create script callable from react
This commit is contained in:
@@ -11,8 +11,8 @@ const dialect = {
|
||||
|
||||
/** @type {import('@dbgate/types').EngineDriver} */
|
||||
const driver = {
|
||||
async connect({ mysql }, { server, port, user, password, database }) {
|
||||
const connection = mysql.createConnection({
|
||||
async connect(nativeModules, { server, port, user, password, database }) {
|
||||
const connection = nativeModules.mysql.createConnection({
|
||||
host: server,
|
||||
port,
|
||||
user,
|
||||
@@ -20,6 +20,7 @@ const driver = {
|
||||
database
|
||||
});
|
||||
connection._database_name = database;
|
||||
connection._nativeModules = nativeModules;
|
||||
return connection;
|
||||
},
|
||||
async query(connection, sql) {
|
||||
|
||||
Reference in New Issue
Block a user