typescript common lib

This commit is contained in:
Jan Prochazka
2020-02-01 19:57:07 +01:00
parent 8291885d56
commit d22058382f
15 changed files with 3434 additions and 94 deletions

36
lib/src/index.ts Normal file
View File

@@ -0,0 +1,36 @@
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[];
}
export interface OpenedDatabaseConnection {
conid: string;
database: string;
structure: DatabaseInfo;
subprocess: ChildProcess;
}
export function sum(a: number, b: number) {
return a + b;
}