mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 19:26:00 +00:00
style
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
const fp = require('lodash/fp');
|
||||
const _ = require('lodash');
|
||||
const connections = require('./connections');
|
||||
const socket = require('../utility/socket');
|
||||
const { fork } = require('child_process');
|
||||
const DatabaseAnalyser = require('../engines/default/DatabaseAnalyser')
|
||||
const DatabaseAnalyser = require('../engines/default/DatabaseAnalyser');
|
||||
|
||||
module.exports = {
|
||||
/** @type {import('../types').OpenedDatabaseConnection[]} */
|
||||
@@ -39,9 +39,12 @@ module.exports = {
|
||||
return newOpened;
|
||||
},
|
||||
|
||||
listTables_meta: 'get',
|
||||
async listTables({ id, database }) {
|
||||
listObjects_meta: 'get',
|
||||
async listObjects({ id, database }) {
|
||||
const opened = await this.ensureOpened(id, database);
|
||||
return opened.structure.tables; // .map(fp.pick(['tableName', 'schemaName']));
|
||||
const { tables } = opened.structure;
|
||||
return {
|
||||
tables: _.sortBy(tables, x => `${x.schemaName}.${x.pureName}`),
|
||||
}; // .map(fp.pick(['tableName', 'schemaName']));
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
select
|
||||
o.name as tableName, s.name as schemaName, o.object_id,
|
||||
o.name as pureName, s.name as schemaName, o.object_id,
|
||||
o.create_date, o.modify_date
|
||||
from sys.tables o
|
||||
inner join sys.schemas s on o.schema_id = s.schema_id
|
||||
|
||||
@@ -7,15 +7,12 @@ export interface EngineDriver {
|
||||
analyseIncremental(pool): Promise<void>;
|
||||
}
|
||||
|
||||
// export interface NameWithSchema {
|
||||
// schema: string;
|
||||
// name: string;
|
||||
// }
|
||||
|
||||
export interface TableInfo {
|
||||
// name: NameWithSchema;
|
||||
tableName: string;
|
||||
export interface NamedObjectInfo {
|
||||
pureName: string;
|
||||
schemaName: string;
|
||||
}
|
||||
|
||||
export interface TableInfo extends NamedObjectInfo {
|
||||
}
|
||||
|
||||
export interface DatabaseInfo {
|
||||
|
||||
Reference in New Issue
Block a user