-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdata-access-object-agent.interface.ts
More file actions
118 lines (95 loc) · 4.17 KB
/
data-access-object-agent.interface.ts
File metadata and controls
118 lines (95 loc) · 4.17 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import { Stream } from 'node:stream';
import { AutocompleteFieldsDS } from '../../data-access-layer/shared/data-structures/autocomplete-fields.ds.js';
import { FilteringFieldsDS } from '../../data-access-layer/shared/data-structures/filtering-fields.ds.js';
import { ForeignKeyDS } from '../../data-access-layer/shared/data-structures/foreign-key.ds.js';
import { FoundRowsDS } from '../../data-access-layer/shared/data-structures/found-rows.ds.js';
import { PrimaryKeyDS } from '../../data-access-layer/shared/data-structures/primary-key.ds.js';
import { ReferencedTableNamesAndColumnsDS } from '../../data-access-layer/shared/data-structures/referenced-table-names-columns.ds.js';
import { TableDS } from '../../data-access-layer/shared/data-structures/table.ds.js';
import { TableSettingsDS } from '../../data-access-layer/shared/data-structures/table-settings.ds.js';
import { TableStructureDS } from '../../data-access-layer/shared/data-structures/table-structure.ds.js';
import { TestConnectionResultDS } from '../../data-access-layer/shared/data-structures/test-result-connection.ds.js';
import { ValidateTableSettingsDS } from '../../data-access-layer/shared/data-structures/validate-table-settings.ds.js';
export interface IDataAccessObjectAgent {
addRowInTable(
tableName: string,
row: Record<string, unknown>,
userEmail: string,
): Promise<Record<string, unknown> | number>;
deleteRowInTable(
tableName: string,
primaryKey: Record<string, unknown>,
userEmail: string,
): Promise<Record<string, unknown>>;
getIdentityColumns(
tableName: string,
referencedFieldName: string,
identityColumnName: string,
fieldValues: Array<string | number>,
userEmail: string,
): Promise<Array<Record<string, unknown>>>;
getRowByPrimaryKey(
tableName: string,
primaryKey: Record<string, unknown>,
settings: TableSettingsDS,
userEmail: string,
): Promise<Record<string, unknown>>;
bulkGetRowsFromTableByPrimaryKeys(
tableName: string,
primaryKeys: Array<Record<string, unknown>>,
settings: TableSettingsDS,
userEmail: string,
): Promise<Array<Record<string, unknown>>>;
getRowsFromTable(
tableName: string,
settings: TableSettingsDS,
page: number,
perPage: number,
searchedFieldValue: string,
filteringFields: Array<FilteringFieldsDS>,
autocompleteFields: AutocompleteFieldsDS,
tableStructure: TableStructureDS[] | null,
userEmail: string,
): Promise<FoundRowsDS>;
getTableForeignKeys(tableName: string, userEmail: string): Promise<Array<ForeignKeyDS>>;
getTablePrimaryColumns(tableName: string, userEmail: string): Promise<Array<PrimaryKeyDS>>;
getTablesFromDB(userEmail?: string): Promise<Array<TableDS>>;
getTableStructure(tableName: string, userEmail: string): Promise<Array<TableStructureDS>>;
getTableStructureWithoutCache(tableName: string, userEmail: string): Promise<Array<TableStructureDS>>;
invalidateMetadataCache(): void;
testConnect(): Promise<TestConnectionResultDS>;
updateRowInTable(
tableName: string,
row: Record<string, unknown>,
primaryKey: Record<string, unknown>,
userEmail: string,
): Promise<Record<string, unknown>>;
bulkUpdateRowsInTable(
tableName: string,
newValues: Record<string, unknown>,
primaryKeys: Array<Record<string, unknown>>,
userEmail: string,
): Promise<Array<Record<string, unknown>>>;
bulkDeleteRowsInTable(
tableName: string,
primaryKeys: Array<Record<string, unknown>>,
userEmail: string,
): Promise<number>;
validateSettings(settings: ValidateTableSettingsDS, tableName: string, userEmail: string): Promise<Array<string>>;
getReferencedTableNamesAndColumns(
tableName: string,
userEmail: string,
): Promise<Array<ReferencedTableNamesAndColumnsDS>>;
isView(tableName: string, userEmail: string): Promise<boolean>;
getTableRowsStream(
tableName: string,
settings: TableSettingsDS,
page: number,
perPage: number,
searchedFieldValue: string,
filteringFields: Array<FilteringFieldsDS>,
): Promise<Stream & AsyncIterable<never>>;
importCSVInTable(file: Express.Multer.File, tableName: string, userEmail: string): Promise<void>;
executeRawQuery(query: string, tableName: string, userEmail: string): Promise<Array<Record<string, unknown>>>;
getSchemaHash(userEmail: string): Promise<string>;
}