mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
mysql - result structure
This commit is contained in:
parent
6188e90340
commit
c0b45a56d8
@ -23,7 +23,6 @@ class MySqlAnalyser extends DatabaseAnalayser {
|
||||
functions = false,
|
||||
triggers = false
|
||||
) {
|
||||
console.log('DB', this.pool._database_name);
|
||||
let res = await loadQuery(resFileName);
|
||||
res = res.replace('=[OBJECT_NAME_CONDITION]', ' is not null');
|
||||
res = res.replace('#DATABASE#', this.pool._database_name);
|
||||
|
@ -21,7 +21,7 @@ const driver = {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.query(sql, function(error, results, fields) {
|
||||
if (error) reject(error);
|
||||
resolve({ rows: results });
|
||||
resolve({ rows: results, columns: fields });
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -41,7 +41,6 @@ async function handleTableData({ msgid, schemaName, pureName }) {
|
||||
select.from = { schemaName, pureName };
|
||||
select.selectAll = true;
|
||||
const sql = select.toSql(driver);
|
||||
console.log('SQL', sql);
|
||||
const res = await driver.query(systemConnection, sql);
|
||||
|
||||
process.send({ msgtype: 'response', msgid, ...res });
|
||||
|
6
types/engines.d.ts
vendored
6
types/engines.d.ts
vendored
@ -10,12 +10,6 @@ export interface EngineDriver {
|
||||
user,
|
||||
password,
|
||||
database
|
||||
}: {
|
||||
server: any;
|
||||
port: any;
|
||||
user: any;
|
||||
password: any;
|
||||
database: any;
|
||||
}): any;
|
||||
query(pool: any, sql: string): Promise<QueryResult>;
|
||||
getVersion(pool: any): Promise<{ version: string }>;
|
||||
|
5
types/query.d.ts
vendored
5
types/query.d.ts
vendored
@ -3,6 +3,11 @@ export interface RangeDefinition {
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface QueryResultColumn {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface QueryResult {
|
||||
rows: any[];
|
||||
columns: QueryResultColumn[];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user