-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschemaInterfaces.ts
36 lines (34 loc) · 1.3 KB
/
schemaInterfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Options from './options'
export interface ColumnDefinition {
columnName?: string,
columnRawName?:string,
udtName: string,
nullable: boolean,
tsType?: string,
columnComment?: string,
}
export interface TableProperties {
tableComment: string, // 表的注释
tableName?: string, //驼峰后表名
tableRawName?: string,
}
export interface TableDefinition {
[columnName: string]: ColumnDefinition,
}
export interface SchemaDefinition {
[tableName: string]: {
tableProperties: TableProperties; // 表的属性
tableDefinition: TableDefinition}
}
export interface Database {
connectionString: string
query (queryString: string): Promise<Object[]>
getDefaultSchema (): string
getEnumTypes (schema?: string): any
//getTableDefinition (tableName: string, tableSchema: string): Promise<TableDefinition>
myGetTableDefinition (tableName: string, tableSchema: string): Promise<TableDefinition>
//getTableTypes (tableName: string, tableSchema: string, options: Options): Promise<TableDefinition>
myGetTableTypes (tableName: string, tableSchema: string, options: Options): Promise<TableDefinition>
myGetTableComments(tables: string[], tableSchema: string): Promise<SchemaDefinition>
getSchemaTables (schemaName: string): Promise<string[]>
}