diff --git a/packages/api/src/shell/queryReader.js b/packages/api/src/shell/queryReader.js index 72cb56d3..087b5439 100644 --- a/packages/api/src/shell/queryReader.js +++ b/packages/api/src/shell/queryReader.js @@ -8,7 +8,7 @@ async function queryReader({ connection, sql }) { const driver = engines(connection); const pool = await driverConnect(driver, connection); console.log(`Connected.`); - return await driver.readableStream(pool, sql); + return await driver.readQuery(pool, sql); } module.exports = queryReader; diff --git a/packages/engines/mssql/index.js b/packages/engines/mssql/index.js index 8a2d772c..4f9bd7f4 100644 --- a/packages/engines/mssql/index.js +++ b/packages/engines/mssql/index.js @@ -154,7 +154,7 @@ const driver = { return request; }, - async readableStream(pool, sql) { + async readQuery(pool, sql) { const request = await pool.request(); const { stream } = pool._nativeModules; diff --git a/packages/engines/mysql/index.js b/packages/engines/mysql/index.js index 39c0b4be..b943be03 100644 --- a/packages/engines/mysql/index.js +++ b/packages/engines/mysql/index.js @@ -84,7 +84,7 @@ const driver = { return query; }, - async readableStream(connection, sql) { + async readQuery(connection, sql) { const query = connection.query(sql); const { stream } = connection._nativeModules; diff --git a/packages/types/engines.d.ts b/packages/types/engines.d.ts index 16e459e7..a6fb0374 100644 --- a/packages/types/engines.d.ts +++ b/packages/types/engines.d.ts @@ -1,4 +1,4 @@ -import stream from 'stream' +import stream from 'stream'; import { QueryResult } from './query'; import { SqlDialect } from './dialect'; import { SqlDumper } from './dumper'; @@ -17,7 +17,8 @@ export interface EngineDriver { connect(nativeModules, { server, port, user, password, database }): any; query(pool: any, sql: string): Promise; stream(pool: any, sql: string, options: StreamOptions); - readableStream(pool: any, sql: string): Promise; + readQuery(pool: any, sql: string): Promise; + writeTable(pool: any, { schemaName, pureName }): Promise; getVersion(pool: any): Promise<{ version: string }>; listDatabases( pool: any