prostgles-server 4.2.647 → 4.2.649
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/.github/workflows/main.yml +1 -1
- package/debug/als-build.log +4 -0
- package/debug/als-e2e.log +1747 -0
- package/debug/als-lint.log +4 -0
- package/debug/als-npm-test.log +712 -0
- package/debug/als-row-parts-e2e.log +1759 -0
- package/debug/als-row-parts-npm-test.log +716 -0
- package/debug/als-typecheck.log +8 -0
- package/debug/als-unified-build.log +4 -0
- package/debug/als-unified-lint.log +4 -0
- package/debug/als-unified-test-build.log +11 -0
- package/debug/als-unified-test-server.log +3444 -0
- package/debug/inspect-ui-sync.cjs +24 -0
- package/debug/subscription-cleanup-repro.log +662 -0
- package/debug/subscription-cleanup-trace.log +7230 -0
- package/debug/sync-bigint-DBGeneratedSchema.backup +489 -0
- package/debug/sync-bigint-build.log +4 -0
- package/debug/sync-bigint-client-build.log +0 -0
- package/debug/sync-bigint-lint.log +4 -0
- package/debug/sync-bigint-server-build.log +0 -0
- package/debug/sync-comment-DBGeneratedSchema.backup +489 -0
- package/debug/sync-delay-gate-DBGeneratedSchema.backup +489 -0
- package/debug/sync-delay-gate-build.log +0 -0
- package/debug/sync-diff-review-test.log +132 -0
- package/debug/sync-followup-build.log +4 -0
- package/debug/sync-notification-before.log +121 -0
- package/debug/sync-trigger-cleanup-before.log +134 -0
- package/debug/sync-trigger-fix-e2e.log +1758 -0
- package/debug/sync-trigger-fix-npm-test.log +1815 -0
- package/debug/sync-trigger-lint.log +4 -0
- package/debug/trace-subscription-cleanup.cjs +19 -0
- package/debug/ui-sync-database-snapshot.log +8 -0
- package/debug/ui-sync-investigation.md +30 -0
- package/debug/ui-sync-server-tests.log +553 -0
- package/dist/Audit/AuditTable.d.ts +1 -1
- package/dist/DboBuilder/DboBuilder.d.ts.map +1 -1
- package/dist/DboBuilder/DboBuilder.js +4 -2
- package/dist/DboBuilder/DboBuilder.js.map +1 -1
- package/dist/DboBuilder/DboBuilder.spec.js +3 -1
- package/dist/DboBuilder/DboBuilder.spec.js.map +1 -1
- package/dist/DboBuilder/TableHandler/TableHandler.d.ts.map +1 -1
- package/dist/DboBuilder/TableHandler/TableHandler.js +3 -2
- package/dist/DboBuilder/TableHandler/TableHandler.js.map +1 -1
- package/dist/DboBuilder/TableHandler/delete.d.ts.map +1 -1
- package/dist/DboBuilder/TableHandler/delete.js +4 -3
- package/dist/DboBuilder/TableHandler/delete.js.map +1 -1
- package/dist/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.d.ts.map +1 -1
- package/dist/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.js +7 -6
- package/dist/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.js.map +1 -1
- package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts +1 -1
- package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts.map +1 -1
- package/dist/DboBuilder/schema/getTablesForSchemaPostgresSQL.d.ts +2 -2
- package/dist/ExecutionContext.d.ts +32 -0
- package/dist/ExecutionContext.d.ts.map +1 -0
- package/dist/ExecutionContext.js +25 -0
- package/dist/ExecutionContext.js.map +1 -0
- package/dist/JSONBSchemaValidation/validateJSONBSchemaSQL.d.ts +1 -1
- package/dist/Prostgles.d.ts +5 -0
- package/dist/Prostgles.d.ts.map +1 -1
- package/dist/Prostgles.js +5 -0
- package/dist/Prostgles.js.map +1 -1
- package/dist/PubSubManager/PubSubManager.d.ts +9 -26
- package/dist/PubSubManager/PubSubManager.d.ts.map +1 -1
- package/dist/PubSubManager/PubSubManager.js +27 -23
- package/dist/PubSubManager/PubSubManager.js.map +1 -1
- package/dist/PubSubManager/deleteOrphanedTriggers.d.ts.map +1 -1
- package/dist/PubSubManager/deleteOrphanedTriggers.js +5 -3
- package/dist/PubSubManager/deleteOrphanedTriggers.js.map +1 -1
- package/dist/PubSubManager/init/getDataWatchFunctionQuery.d.ts.map +1 -1
- package/dist/PubSubManager/init/getDataWatchFunctionQuery.js +1 -2
- package/dist/PubSubManager/init/getDataWatchFunctionQuery.js.map +1 -1
- package/dist/PubSubManager/init/getPubSubManagerInitQuery.d.ts.map +1 -1
- package/dist/PubSubManager/init/getPubSubManagerInitQuery.js +3 -2
- package/dist/PubSubManager/init/getPubSubManagerInitQuery.js.map +1 -1
- package/dist/PubSubManager/notifListener.js +2 -2
- package/dist/PubSubManager/notifListener.js.map +1 -1
- package/dist/PubSubManager/refreshTriggers.d.ts.map +1 -1
- package/dist/PubSubManager/refreshTriggers.js +5 -3
- package/dist/PubSubManager/refreshTriggers.js.map +1 -1
- package/dist/PublishParser/PublishParser.d.ts.map +1 -1
- package/dist/PublishParser/PublishParser.js +14 -1
- package/dist/PublishParser/PublishParser.js.map +1 -1
- package/dist/PublishParser/getFunctionRelatedRecords.d.ts +5 -0
- package/dist/PublishParser/getFunctionRelatedRecords.d.ts.map +1 -0
- package/dist/PublishParser/getFunctionRelatedRecords.js +26 -0
- package/dist/PublishParser/getFunctionRelatedRecords.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/initProstgles.d.ts +3 -0
- package/dist/initProstgles.d.ts.map +1 -1
- package/dist/initProstgles.js +1 -0
- package/dist/initProstgles.js.map +1 -1
- package/dist/runClientRequest.d.ts.map +1 -1
- package/dist/runClientRequest.js +6 -1
- package/dist/runClientRequest.js.map +1 -1
- package/lib/DboBuilder/DboBuilder.spec.ts +3 -7
- package/lib/DboBuilder/DboBuilder.ts +4 -2
- package/lib/DboBuilder/TableHandler/TableHandler.ts +14 -11
- package/lib/DboBuilder/TableHandler/delete.ts +14 -11
- package/lib/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.ts +28 -21
- package/lib/ExecutionContext.ts +60 -0
- package/lib/Prostgles.ts +8 -4
- package/lib/PubSubManager/PubSubManager.ts +31 -28
- package/lib/PubSubManager/deleteOrphanedTriggers.ts +5 -3
- package/lib/PubSubManager/init/getDataWatchFunctionQuery.ts +1 -2
- package/lib/PubSubManager/init/getPubSubManagerInitQuery.ts +3 -2
- package/lib/PubSubManager/notifListener.ts +2 -2
- package/lib/PubSubManager/refreshTriggers.ts +7 -5
- package/lib/PublishParser/PublishParser.ts +17 -1
- package/lib/PublishParser/getFunctionRelatedRecords.ts +25 -0
- package/lib/index.ts +2 -4
- package/lib/initProstgles.ts +5 -4
- package/lib/runClientRequest.ts +16 -8
- package/package.json +1 -1
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
/* Schema definition generated by prostgles-server */
|
|
2
|
+
|
|
3
|
+
export type DBGeneratedSchema = {
|
|
4
|
+
__rb_test_commit: {
|
|
5
|
+
columns: {
|
|
6
|
+
id?: null | number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
};
|
|
10
|
+
"\"\"\"*\"\"\"": {
|
|
11
|
+
columns: {
|
|
12
|
+
"\"*\""?: null | string;
|
|
13
|
+
id?: number;
|
|
14
|
+
qq?: null | string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
};
|
|
18
|
+
"\"\"\"quoted0\"\"\"": {
|
|
19
|
+
columns: {
|
|
20
|
+
"\"id0\""?: number;
|
|
21
|
+
"\"quoted1_id\""?: null | number;
|
|
22
|
+
"\"text_col0\""?: null | string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
};
|
|
26
|
+
"\"\"\"quoted1\"\"\"": {
|
|
27
|
+
columns: {
|
|
28
|
+
"\"id1\""?: number;
|
|
29
|
+
"\"quoted2_id\""?: null | number;
|
|
30
|
+
"\"text_col1\""?: null | string;
|
|
31
|
+
};
|
|
32
|
+
referencedBy: {"\"\"\"quoted0\"\"\"":["\"quoted1_id\""]};
|
|
33
|
+
};
|
|
34
|
+
"\"\"\"quoted2\"\"\"": {
|
|
35
|
+
columns: {
|
|
36
|
+
"\"id2\""?: number;
|
|
37
|
+
"\"text_col2\""?: null | string;
|
|
38
|
+
};
|
|
39
|
+
referencedBy: {"\"\"\"quoted1\"\"\"":["\"quoted2_id\""]};
|
|
40
|
+
};
|
|
41
|
+
"\"*\"": {
|
|
42
|
+
columns: {
|
|
43
|
+
"*"?: null | string;
|
|
44
|
+
id?: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
};
|
|
48
|
+
api_table: {
|
|
49
|
+
columns: {
|
|
50
|
+
col1?: null | string;
|
|
51
|
+
id?: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
};
|
|
55
|
+
bytea_test: {
|
|
56
|
+
columns: {
|
|
57
|
+
id?: number;
|
|
58
|
+
value?: null | Uint8Array;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
};
|
|
62
|
+
ex_j_ins: {
|
|
63
|
+
columns: {
|
|
64
|
+
added?: null | string;
|
|
65
|
+
id?: number;
|
|
66
|
+
name: string;
|
|
67
|
+
public?: null | string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
};
|
|
71
|
+
files: {
|
|
72
|
+
columns: {
|
|
73
|
+
added?: string;
|
|
74
|
+
cloud_url?: null | string;
|
|
75
|
+
content_length?: number | string;
|
|
76
|
+
content_type?: string;
|
|
77
|
+
data: Uint8Array;
|
|
78
|
+
deleted?: null | string;
|
|
79
|
+
deleted_from_storage?: null | string;
|
|
80
|
+
description?: null | string;
|
|
81
|
+
etag?: string;
|
|
82
|
+
extension?: string;
|
|
83
|
+
id?: string;
|
|
84
|
+
metadata?: null | { description: string; };
|
|
85
|
+
original_last_modified?: null | string;
|
|
86
|
+
original_name: string;
|
|
87
|
+
signed_url?: null | string;
|
|
88
|
+
signed_url_expires?: null | number | string;
|
|
89
|
+
storage_key?: null | string;
|
|
90
|
+
updated?: string;
|
|
91
|
+
url?: string;
|
|
92
|
+
version?: number;
|
|
93
|
+
};
|
|
94
|
+
referencedBy: {"files_versions":["file_id"],"users_public_info":["avatar"]};
|
|
95
|
+
};
|
|
96
|
+
files_versions: {
|
|
97
|
+
columns: {
|
|
98
|
+
added?: string;
|
|
99
|
+
cloud_url?: null | string;
|
|
100
|
+
content_length?: number | string;
|
|
101
|
+
content_type?: string;
|
|
102
|
+
created?: string;
|
|
103
|
+
deleted?: null | string;
|
|
104
|
+
deleted_from_storage?: null | string;
|
|
105
|
+
description?: null | string;
|
|
106
|
+
etag?: string;
|
|
107
|
+
extension?: string;
|
|
108
|
+
file_id: string;
|
|
109
|
+
id?: string;
|
|
110
|
+
metadata?: null | { description: string; };
|
|
111
|
+
original_last_modified?: null | string;
|
|
112
|
+
original_name: string;
|
|
113
|
+
signed_url?: null | string;
|
|
114
|
+
signed_url_expires?: null | number | string;
|
|
115
|
+
storage_key: string;
|
|
116
|
+
updated?: string;
|
|
117
|
+
url?: string;
|
|
118
|
+
version: number;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
};
|
|
122
|
+
geography_columns: {
|
|
123
|
+
columns: {
|
|
124
|
+
coord_dimension?: null | number;
|
|
125
|
+
f_geography_column?: null | string;
|
|
126
|
+
f_table_catalog?: null | string;
|
|
127
|
+
f_table_name?: null | string;
|
|
128
|
+
f_table_schema?: null | string;
|
|
129
|
+
srid?: null | number;
|
|
130
|
+
type?: null | string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
};
|
|
134
|
+
geometry_columns: {
|
|
135
|
+
columns: {
|
|
136
|
+
coord_dimension?: null | number;
|
|
137
|
+
f_geometry_column?: null | string;
|
|
138
|
+
f_table_catalog?: null | string;
|
|
139
|
+
f_table_name?: null | string;
|
|
140
|
+
f_table_schema?: null | string;
|
|
141
|
+
srid?: null | number;
|
|
142
|
+
type?: null | string;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
};
|
|
146
|
+
insert_rules: {
|
|
147
|
+
columns: {
|
|
148
|
+
added?: null | string;
|
|
149
|
+
id?: number;
|
|
150
|
+
name?: null | string;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
};
|
|
154
|
+
items: {
|
|
155
|
+
columns: {
|
|
156
|
+
h?: null | string[];
|
|
157
|
+
id?: number;
|
|
158
|
+
name?: null | string;
|
|
159
|
+
};
|
|
160
|
+
referencedBy: {"items2":["items_id"],"items4a":["items_id"],"items_multi":["items0_id","items1_id","items2_id","items3_id"],"slow_items":["id"],"very_slow_items":["id"]};
|
|
161
|
+
};
|
|
162
|
+
items_multi: {
|
|
163
|
+
columns: {
|
|
164
|
+
id?: number;
|
|
165
|
+
items0_id?: null | number;
|
|
166
|
+
items1_id?: null | number;
|
|
167
|
+
items2_id?: null | number;
|
|
168
|
+
items3_id?: null | number;
|
|
169
|
+
name?: null | string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
};
|
|
173
|
+
items2: {
|
|
174
|
+
columns: {
|
|
175
|
+
hh?: null | string[];
|
|
176
|
+
id?: number;
|
|
177
|
+
items_id?: null | number;
|
|
178
|
+
name?: null | string;
|
|
179
|
+
};
|
|
180
|
+
referencedBy: {"items4a":["items2_id"]};
|
|
181
|
+
};
|
|
182
|
+
items3: {
|
|
183
|
+
columns: {
|
|
184
|
+
h?: null | string[];
|
|
185
|
+
id?: number;
|
|
186
|
+
name?: null | string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
};
|
|
190
|
+
items4: {
|
|
191
|
+
columns: {
|
|
192
|
+
added?: null | string;
|
|
193
|
+
id?: number;
|
|
194
|
+
name: string;
|
|
195
|
+
public?: null | string;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
};
|
|
199
|
+
items4_pub: {
|
|
200
|
+
columns: {
|
|
201
|
+
added?: null | string;
|
|
202
|
+
id?: number;
|
|
203
|
+
name: string;
|
|
204
|
+
public?: null | string;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
};
|
|
208
|
+
items4a: {
|
|
209
|
+
columns: {
|
|
210
|
+
id?: number;
|
|
211
|
+
items_id?: null | number;
|
|
212
|
+
items2_id?: null | number;
|
|
213
|
+
name?: null | string;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
};
|
|
217
|
+
lookup_col1: {
|
|
218
|
+
columns: {
|
|
219
|
+
description?: null | string;
|
|
220
|
+
id: "a" | "b"
|
|
221
|
+
};
|
|
222
|
+
referencedBy: {"uuid_text":["col1","col2","col3"]};
|
|
223
|
+
};
|
|
224
|
+
newly_created_table: {
|
|
225
|
+
columns: {
|
|
226
|
+
id?: null | number;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
};
|
|
230
|
+
obj_table: {
|
|
231
|
+
columns: {
|
|
232
|
+
id?: number;
|
|
233
|
+
obj?: null | any;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
};
|
|
237
|
+
planes: {
|
|
238
|
+
columns: {
|
|
239
|
+
flight_number?: null | string;
|
|
240
|
+
id?: number;
|
|
241
|
+
last_updated: number | string;
|
|
242
|
+
x?: null | number;
|
|
243
|
+
y?: null | number;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
};
|
|
247
|
+
"prostgles_test.basic": {
|
|
248
|
+
columns: {
|
|
249
|
+
id?: number;
|
|
250
|
+
txt?: null | string;
|
|
251
|
+
};
|
|
252
|
+
referencedBy: {"prostgles_test.basic1":["id_basic"]};
|
|
253
|
+
};
|
|
254
|
+
"prostgles_test.basic1": {
|
|
255
|
+
columns: {
|
|
256
|
+
id?: number;
|
|
257
|
+
id_basic?: null | number;
|
|
258
|
+
txt?: null | string;
|
|
259
|
+
};
|
|
260
|
+
referencedBy: {"prostgles_test.mv_basic1":["id"]};
|
|
261
|
+
};
|
|
262
|
+
"prostgles_test.mv_basic1": {
|
|
263
|
+
columns: {
|
|
264
|
+
id: number;
|
|
265
|
+
id_basic: number;
|
|
266
|
+
txt: string;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
};
|
|
270
|
+
rec: {
|
|
271
|
+
columns: {
|
|
272
|
+
id?: number;
|
|
273
|
+
parent_id?: null | number;
|
|
274
|
+
recf?: null | number;
|
|
275
|
+
};
|
|
276
|
+
referencedBy: {"rec":["parent_id"]};
|
|
277
|
+
};
|
|
278
|
+
rec_ref: {
|
|
279
|
+
columns: {
|
|
280
|
+
id?: number;
|
|
281
|
+
};
|
|
282
|
+
referencedBy: {"rec":["recf"]};
|
|
283
|
+
};
|
|
284
|
+
schema_version: {
|
|
285
|
+
columns: {
|
|
286
|
+
id: number | string;
|
|
287
|
+
table_config: any;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
};
|
|
291
|
+
self_join: {
|
|
292
|
+
columns: {
|
|
293
|
+
id?: number;
|
|
294
|
+
my_id?: null | number;
|
|
295
|
+
my_id1?: null | number;
|
|
296
|
+
name?: null | string;
|
|
297
|
+
};
|
|
298
|
+
referencedBy: {"self_join":["my_id","my_id1"]};
|
|
299
|
+
};
|
|
300
|
+
shapes: {
|
|
301
|
+
columns: {
|
|
302
|
+
geog?: null | string;
|
|
303
|
+
geom?: null | string;
|
|
304
|
+
id?: string;
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
};
|
|
308
|
+
slow_items: {
|
|
309
|
+
columns: {
|
|
310
|
+
h?: null | string[];
|
|
311
|
+
id?: null | number;
|
|
312
|
+
name?: null | string;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
};
|
|
316
|
+
spatial_ref_sys: {
|
|
317
|
+
columns: {
|
|
318
|
+
auth_name?: null | string;
|
|
319
|
+
auth_srid?: null | number;
|
|
320
|
+
proj4text?: null | string;
|
|
321
|
+
srid: number;
|
|
322
|
+
srtext?: null | string;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
};
|
|
326
|
+
symbols: {
|
|
327
|
+
columns: {
|
|
328
|
+
id: string;
|
|
329
|
+
};
|
|
330
|
+
referencedBy: {"trades":["symbol"]};
|
|
331
|
+
};
|
|
332
|
+
table_name3434: {
|
|
333
|
+
columns: {
|
|
334
|
+
id: number;
|
|
335
|
+
};
|
|
336
|
+
referencedBy: {"table_name3434cccc":["id","id2"]};
|
|
337
|
+
};
|
|
338
|
+
table_name3434cccc: {
|
|
339
|
+
columns: {
|
|
340
|
+
id?: null | number;
|
|
341
|
+
id2?: null | number;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
};
|
|
345
|
+
tjson: {
|
|
346
|
+
columns: {
|
|
347
|
+
colOneOf: "a" | "b" | "c"
|
|
348
|
+
json: { a: boolean; arr: "1" | "2" | "3"; arr1: 1 | 2 | 3; arr2: number[]; arrStr?: null | string[]; o?: | null
|
|
349
|
+
| { o1: number; }
|
|
350
|
+
| { o2: boolean; }; };
|
|
351
|
+
jsonOneOf?:
|
|
352
|
+
| null
|
|
353
|
+
| { command: "a"; }
|
|
354
|
+
| { command: "b"; option: number[]; }
|
|
355
|
+
status?:
|
|
356
|
+
| null
|
|
357
|
+
| { ok: string; }
|
|
358
|
+
| { err: string; }
|
|
359
|
+
| { loading: { loaded: number; total: number; }; }
|
|
360
|
+
table_config?: null | { referencedTables?: ( { name: string; minFiles: number; } )[]; recType?: null | Record<"a" | "b", { bools: boolean[]; }>; };
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
};
|
|
364
|
+
tr1: {
|
|
365
|
+
columns: {
|
|
366
|
+
id?: number;
|
|
367
|
+
t1?: null | string;
|
|
368
|
+
};
|
|
369
|
+
referencedBy: {"tr2":["tr1_id"]};
|
|
370
|
+
};
|
|
371
|
+
tr2: {
|
|
372
|
+
columns: {
|
|
373
|
+
id?: number;
|
|
374
|
+
t1?: null | string;
|
|
375
|
+
t2?: null | string;
|
|
376
|
+
tr1_id?: null | number;
|
|
377
|
+
};
|
|
378
|
+
referencedBy: {"tr3":["tr2_id"]};
|
|
379
|
+
};
|
|
380
|
+
tr3: {
|
|
381
|
+
columns: {
|
|
382
|
+
id?: number;
|
|
383
|
+
t2?: null | string;
|
|
384
|
+
tr2_id?: null | number;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
};
|
|
388
|
+
trades: {
|
|
389
|
+
columns: {
|
|
390
|
+
id?: number;
|
|
391
|
+
price: number | string;
|
|
392
|
+
symbol: string;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
};
|
|
396
|
+
users: {
|
|
397
|
+
columns: {
|
|
398
|
+
email: string;
|
|
399
|
+
id?: number;
|
|
400
|
+
preferences: { showIntro?: boolean; theme?: "light" | "dark" | "auto"; others: any[]; };
|
|
401
|
+
status: "active" | "disabled" | "pending"
|
|
402
|
+
type: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
};
|
|
406
|
+
users_public_info: {
|
|
407
|
+
columns: {
|
|
408
|
+
avatar?: null | string;
|
|
409
|
+
id?: number;
|
|
410
|
+
name?: null | string;
|
|
411
|
+
sid?: null | string;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
};
|
|
415
|
+
uuid_text: {
|
|
416
|
+
columns: {
|
|
417
|
+
col1?: null | "a" | "b"
|
|
418
|
+
col2?: null | "a" | "b"
|
|
419
|
+
col3?: null | "a" | "b"
|
|
420
|
+
id?: null | string;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
};
|
|
424
|
+
v_items: {
|
|
425
|
+
columns: {
|
|
426
|
+
id?: null | number;
|
|
427
|
+
name?: null | string;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
};
|
|
431
|
+
various: {
|
|
432
|
+
columns: {
|
|
433
|
+
added?: null | string;
|
|
434
|
+
h?: null | string[];
|
|
435
|
+
id?: number;
|
|
436
|
+
jsn?: null | any;
|
|
437
|
+
name?: null | string;
|
|
438
|
+
tsv?: null | string;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
};
|
|
442
|
+
very_slow_items: {
|
|
443
|
+
columns: {
|
|
444
|
+
h?: null | string[];
|
|
445
|
+
id?: null | number;
|
|
446
|
+
name?: null | string;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
type CollapseNumberIfStringPresent<T> =
|
|
454
|
+
[Extract<T, string>] extends [never] ? T : Exclude<T, number>;
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Numeric columns that serialize to strings keep the numeric type as well to allow:
|
|
458
|
+
* - inserting numeric values as either numbers or strings
|
|
459
|
+
* - reading numeric values as strings
|
|
460
|
+
*/
|
|
461
|
+
export type NormalizedRow<T extends Record<string, unknown>> = Required<{
|
|
462
|
+
[K in keyof T]: CollapseNumberIfStringPresent<T[K]>;
|
|
463
|
+
}>;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Data types as expected when selecting from the database
|
|
467
|
+
* */
|
|
468
|
+
export type DBSchema = {
|
|
469
|
+
[K in keyof DBGeneratedSchema]: NormalizedRow<DBGeneratedSchema[K]["columns"]>;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Data types as expected when inserting into the database (optional fields might be nullable/with defaults)
|
|
474
|
+
* */
|
|
475
|
+
export type DBSchemaForInsert = {
|
|
476
|
+
[K in keyof DBGeneratedSchema]: DBGeneratedSchema[K]["columns"];
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
export type GeneratedFunctionSchema = {
|
|
482
|
+
"myfunc": (args: { arg1: number; }) => Promise<number>;
|
|
483
|
+
"myfuncVoid": () => Promise<void>;
|
|
484
|
+
"myfuncWithBadReturn": (args: { arg1: number; }) => Promise<string>;
|
|
485
|
+
"myfuncWithComplexReturn": (args: { arg1: number; }) => Promise<(Array<number> | { a: number; b: string; c: { d: boolean } })>;
|
|
486
|
+
"myAdminFunc": (args: { arg1: number; }) => Promise<number>;
|
|
487
|
+
"myfuncForDefault": () => Promise<void>;
|
|
488
|
+
"myfuncForDefault2": (args: { name: string; }) => Promise<({ a: number; b?: undefined } | { b: string; a?: undefined })>;
|
|
489
|
+
}
|