mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 05:36:00 +00:00
show table data
This commit is contained in:
@@ -8,15 +8,15 @@ module.exports = {
|
||||
},
|
||||
async query(client, sql) {
|
||||
const res = await client.query(sql);
|
||||
return res.rows;
|
||||
return { rows: res.rows };
|
||||
},
|
||||
async getVersion(client) {
|
||||
const rows = await this.query(client, 'SELECT version()');
|
||||
const { rows } = await this.query(client, 'SELECT version()');
|
||||
const { version } = rows[0];
|
||||
return { version };
|
||||
},
|
||||
async listDatabases(client) {
|
||||
const res = await this.query(client, 'SELECT datname AS name FROM pg_database WHERE datistemplate = false');
|
||||
return res;
|
||||
const { rows } = await this.query(client, 'SELECT datname AS name FROM pg_database WHERE datistemplate = false');
|
||||
return rows;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user