dbgate-types 4.2.6 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alter-processor.d.ts +18 -0
- package/dbinfo.d.ts +8 -1
- package/dialect.d.ts +22 -0
- package/dumper.d.ts +4 -2
- package/engines.d.ts +2 -2
- package/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ColumnInfo, ConstraintInfo, TableInfo, SqlObjectInfo } from './dbinfo';
|
|
2
|
+
|
|
3
|
+
export interface AlterProcessor {
|
|
4
|
+
createTable(table: TableInfo);
|
|
5
|
+
dropTable(table: TableInfo);
|
|
6
|
+
createColumn(column: ColumnInfo, constraints: ConstraintInfo[]);
|
|
7
|
+
changeColumn(oldColumn: ColumnInfo, newColumn: ColumnInfo, constraints?: ConstraintInfo[]);
|
|
8
|
+
dropColumn(column: ColumnInfo);
|
|
9
|
+
createConstraint(constraint: ConstraintInfo);
|
|
10
|
+
changeConstraint(oldConstraint: ConstraintInfo, newConstraint: ConstraintInfo);
|
|
11
|
+
dropConstraint(constraint: ConstraintInfo);
|
|
12
|
+
renameTable(table: TableInfo, newName: string);
|
|
13
|
+
renameColumn(column: ColumnInfo, newName: string);
|
|
14
|
+
renameConstraint(constraint: ConstraintInfo, newName: string);
|
|
15
|
+
recreateTable(oldTable: TableInfo, newTable: TableInfo);
|
|
16
|
+
createSqlObject(obj: SqlObjectInfo);
|
|
17
|
+
dropSqlObject(obj: SqlObjectInfo);
|
|
18
|
+
}
|
package/dbinfo.d.ts
CHANGED
|
@@ -6,10 +6,13 @@ export interface NamedObjectInfo {
|
|
|
6
6
|
export interface ColumnReference {
|
|
7
7
|
columnName: string;
|
|
8
8
|
refColumnName?: string;
|
|
9
|
+
isIncludedColumn?: boolean;
|
|
10
|
+
isDescending?: boolean;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface ConstraintInfo extends NamedObjectInfo {
|
|
12
|
-
|
|
14
|
+
pairingId?: string;
|
|
15
|
+
constraintName?: string;
|
|
13
16
|
constraintType: 'primaryKey' | 'foreignKey' | 'index' | 'check' | 'unique';
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -38,6 +41,7 @@ export interface CheckInfo extends ConstraintInfo {
|
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
export interface ColumnInfo extends NamedObjectInfo {
|
|
44
|
+
pairingId?: string;
|
|
41
45
|
columnName: string;
|
|
42
46
|
notNull: boolean;
|
|
43
47
|
autoIncrement: boolean;
|
|
@@ -53,10 +57,12 @@ export interface ColumnInfo extends NamedObjectInfo {
|
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
export interface DatabaseObjectInfo extends NamedObjectInfo {
|
|
60
|
+
pairingId?: string;
|
|
56
61
|
objectId?: string;
|
|
57
62
|
createDate?: string;
|
|
58
63
|
modifyDate?: string;
|
|
59
64
|
hashCode?: string;
|
|
65
|
+
objectTypeField?: string;
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
export interface SqlObjectInfo extends DatabaseObjectInfo {
|
|
@@ -103,4 +109,5 @@ export interface DatabaseInfoObjects {
|
|
|
103
109
|
|
|
104
110
|
export interface DatabaseInfo extends DatabaseInfoObjects {
|
|
105
111
|
schemas: SchemaInfo[];
|
|
112
|
+
engine?: string;
|
|
106
113
|
}
|
package/dialect.d.ts
CHANGED
|
@@ -11,4 +11,26 @@ export interface SqlDialect {
|
|
|
11
11
|
anonymousPrimaryKey?: boolean;
|
|
12
12
|
enableConstraintsPerTable?: boolean;
|
|
13
13
|
nosql?: boolean; // mongo
|
|
14
|
+
|
|
15
|
+
dropColumnDependencies?: string[];
|
|
16
|
+
changeColumnDependencies?: string[];
|
|
17
|
+
|
|
18
|
+
dropIndexContainsTableSpec?: boolean;
|
|
19
|
+
|
|
20
|
+
createColumn?: boolean;
|
|
21
|
+
dropColumn?: boolean;
|
|
22
|
+
changeColumn?: boolean;
|
|
23
|
+
createIndex?: boolean;
|
|
24
|
+
dropIndex?: boolean;
|
|
25
|
+
createForeignKey?: boolean;
|
|
26
|
+
dropForeignKey?: boolean;
|
|
27
|
+
createPrimaryKey?: boolean;
|
|
28
|
+
dropPrimaryKey?: boolean;
|
|
29
|
+
createUnique?: boolean;
|
|
30
|
+
dropUnique?: boolean;
|
|
31
|
+
createCheck?: boolean;
|
|
32
|
+
dropCheck?: boolean;
|
|
33
|
+
|
|
34
|
+
dropReferencesWhenDropTable?: boolean;
|
|
35
|
+
disableExplicitTransaction?: boolean;
|
|
14
36
|
}
|
package/dumper.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AlterProcessor } from './alter-processor';
|
|
1
2
|
import { TableInfo } from './dbinfo';
|
|
2
3
|
import { SqlDialect } from './dialect';
|
|
3
4
|
|
|
4
5
|
export type TransformType = 'GROUP:YEAR' | 'GROUP:MONTH' | 'GROUP:DAY' | 'YEAR' | 'MONTH' | 'DAY'; // | 'GROUP:HOUR' | 'GROUP:MINUTE';
|
|
5
6
|
|
|
6
|
-
export interface SqlDumper {
|
|
7
|
+
export interface SqlDumper extends AlterProcessor {
|
|
7
8
|
s: string;
|
|
8
9
|
dialect: SqlDialect;
|
|
9
10
|
|
|
@@ -15,6 +16,7 @@ export interface SqlDumper {
|
|
|
15
16
|
transform(type: TransformType, dumpExpr: () => void);
|
|
16
17
|
|
|
17
18
|
endCommand();
|
|
18
|
-
createTable(table: TableInfo);
|
|
19
19
|
allowIdentityInsert(table: NamedObjectInfo, allow: boolean);
|
|
20
|
+
beginTransaction();
|
|
21
|
+
commitTransaction();
|
|
20
22
|
}
|
package/engines.d.ts
CHANGED
|
@@ -67,8 +67,8 @@ export interface EngineDriver {
|
|
|
67
67
|
name: string;
|
|
68
68
|
}[]
|
|
69
69
|
>;
|
|
70
|
-
analyseFull(pool: any): Promise<DatabaseInfo>;
|
|
71
|
-
analyseIncremental(pool: any, structure: DatabaseInfo): Promise<DatabaseInfo>;
|
|
70
|
+
analyseFull(pool: any, serverVersion): Promise<DatabaseInfo>;
|
|
71
|
+
analyseIncremental(pool: any, structure: DatabaseInfo, serverVersion): Promise<DatabaseInfo>;
|
|
72
72
|
dialect: SqlDialect;
|
|
73
73
|
dialectByVersion(version): SqlDialect;
|
|
74
74
|
createDumper(): SqlDumper;
|
package/index.d.ts
CHANGED
package/package.json
CHANGED