-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
76 lines (68 loc) · 1.83 KB
/
types.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
export interface ImportedRepository {
githubNamespace: string;
githubRepository: string;
splitgraphNamespace: string;
splitgraphRepository: string;
}
export interface TargetSplitgraphRepo {
splitgraphNamespace?: string;
splitgraphRepository: string;
}
export type ExportTable = {
destinationSchema: string;
destinationTable: string;
taskId: string;
sourceQuery?: string;
fallbackCreateTableQuery?: string;
};
export type ExportTableInput = {
namespace: string;
repository: string;
table: string;
};
export type ExportQueryInput = {
sourceQuery: string;
destinationSchema: string;
destinationTable: string;
fallbackCreateTableQuery?: string;
};
export type StartExportToSeafowlRequestShape =
| {
tables: ExportTableInput[];
}
| { queries: ExportQueryInput[] }
| { tables: ExportTableInput[]; queries: ExportQueryInput[] };
export type StartExportToSeafowlResponseData =
| {
tables: {
destinationTable: string;
destinationSchema: string;
taskId: string;
}[];
queries: {
sourceQuery: string;
destinationSchema: string;
destinationTable: string;
taskId: string;
}[];
}
| { error: string };
export type CreateFallbackTableForFailedExportRequestShape = {
/**
* The query to execute to create the fallback table. Note that it should
* already include `destinationSchema` and `destinationTable` in the query,
* but those still need to be passed separately to the endpoint so that it
* can `CREATE SCHEMA` and `DROP TABLE` prior to executing the `CREATE TABLE` query.
*/
fallbackCreateTableQuery: string;
destinationSchema: string;
destinationTable: string;
};
export type CreateFallbackTableForFailedExportResponseData =
| {
error: string;
success: false;
}
| {
success: true;
};