mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 00:36:01 +00:00
table structure tab WIP
This commit is contained in:
29
lib/src/dbinfo.ts
Normal file
29
lib/src/dbinfo.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { ChildProcess } from "child_process";
|
||||
|
||||
export interface NamedObjectInfo {
|
||||
pureName: string;
|
||||
schemaName: string;
|
||||
}
|
||||
|
||||
export interface ColumnInfo {
|
||||
columnName: string;
|
||||
notNull: boolean;
|
||||
autoIncrement: boolean;
|
||||
dataType: string;
|
||||
precision: number;
|
||||
scale: number;
|
||||
length: number;
|
||||
computedExpression: string;
|
||||
isPersisted: boolean;
|
||||
isSparse: boolean;
|
||||
defaultValue: string;
|
||||
defaultConstraint: string;
|
||||
}
|
||||
|
||||
export interface TableInfo extends NamedObjectInfo {
|
||||
columns: ColumnInfo[];
|
||||
}
|
||||
|
||||
export interface DatabaseInfo {
|
||||
tables: TableInfo[];
|
||||
}
|
||||
11
lib/src/engines.ts
Normal file
11
lib/src/engines.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { QueryResult } from "./query";
|
||||
|
||||
export interface EngineDriver {
|
||||
connect({ server, port, user, password });
|
||||
query(pool, sql: string): Promise<QueryResult>;
|
||||
getVersion(pool): Promise<string>;
|
||||
listDatabases(pool): Promise<{ name: string }[]>;
|
||||
analyseFull(pool): Promise<void>;
|
||||
analyseIncremental(pool): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -1,28 +1,5 @@
|
||||
import { ChildProcess } from "child_process";
|
||||
|
||||
export interface QueryResult {
|
||||
rows: any[];
|
||||
}
|
||||
|
||||
export interface EngineDriver {
|
||||
connect({ server, port, user, password });
|
||||
query(pool, sql: string): Promise<QueryResult>;
|
||||
getVersion(pool): Promise<string>;
|
||||
listDatabases(pool): Promise<{ name: string }[]>;
|
||||
analyseFull(pool): Promise<void>;
|
||||
analyseIncremental(pool): Promise<void>;
|
||||
}
|
||||
|
||||
export interface NamedObjectInfo {
|
||||
pureName: string;
|
||||
schemaName: string;
|
||||
}
|
||||
|
||||
export interface TableInfo extends NamedObjectInfo {}
|
||||
|
||||
export interface DatabaseInfo {
|
||||
tables: TableInfo[];
|
||||
}
|
||||
import { DatabaseInfo } from "./dbinfo";
|
||||
|
||||
export interface OpenedDatabaseConnection {
|
||||
conid: string;
|
||||
@@ -31,6 +8,6 @@ export interface OpenedDatabaseConnection {
|
||||
subprocess: ChildProcess;
|
||||
}
|
||||
|
||||
export function sum(a: number, b: number) {
|
||||
return a + b;
|
||||
}
|
||||
export * from "./engines";
|
||||
export * from "./dbinfo";
|
||||
export * from "./query";
|
||||
|
||||
5
lib/src/query.ts
Normal file
5
lib/src/query.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ChildProcess } from "child_process";
|
||||
|
||||
export interface QueryResult {
|
||||
rows: any[];
|
||||
}
|
||||
Reference in New Issue
Block a user