-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
36 lines (36 loc) · 1.27 KB
/
types.d.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 type { mssqlTypes } from '@cityssm/mssql-multi-pool';
interface SourceQueryConfiguration {
sourceType: 'sql';
sourceSql: string;
sourceParameters?: Record<string, unknown>;
}
interface SourceTableConfiguration {
sourceType: 'table';
sourceTableName: string;
}
export type SourceConfiguration = (SourceQueryConfiguration | SourceTableConfiguration) & {
sourceDatabase: mssqlTypes.config;
};
export interface DestinationConfiguration {
destinationTableName: string;
destinationDatabase: mssqlTypes.config;
}
export interface DestinationViewConfiguration {
destinationViewName: string;
destinationDatabase: mssqlTypes.config;
dropOldTables?: boolean;
}
interface ReplicateResultSuccess {
success: true;
destinationRows: number;
destinationTableName: string;
}
export type ErrorStep = 'source:connect' | 'source:request' | 'source:query' | 'destination:buildSql' | 'destination:connect' | 'destination:createTable' | 'destination:insert' | 'destination:createView' | 'destination:alterView' | 'destination:dropTable';
interface ReplicateResultError {
success: false;
destinationRows: number;
errorStep: ErrorStep;
errorMessage: string;
}
export type ReplicateResult = ReplicateResultSuccess | ReplicateResultError;
export {};