table structure tab WIP

This commit is contained in:
Jan Prochazka
2020-02-02 11:31:41 +01:00
parent d22058382f
commit af80a2799f
18 changed files with 318 additions and 57 deletions

29
lib/src/dbinfo.ts Normal file
View 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
View 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>;
}

View File

@@ -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
View File

@@ -0,0 +1,5 @@
import { ChildProcess } from "child_process";
export interface QueryResult {
rows: any[];
}