prostgles-server 2.0.178 → 2.0.179

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.
Files changed (98) hide show
  1. package/dist/AuthHandler.d.ts +4 -4
  2. package/dist/AuthHandler.d.ts.map +1 -1
  3. package/dist/DBSchemaBuilder.d.ts +6 -6
  4. package/dist/DBSchemaBuilder.d.ts.map +1 -1
  5. package/dist/DBSchemaBuilder.js +25 -8
  6. package/dist/DBSchemaBuilder.js.map +1 -1
  7. package/dist/DboBuilder.d.ts +20 -21
  8. package/dist/DboBuilder.d.ts.map +1 -1
  9. package/dist/DboBuilder.js +1 -1
  10. package/dist/DboBuilder.js.map +1 -1
  11. package/dist/Prostgles.d.ts +8 -10
  12. package/dist/Prostgles.d.ts.map +1 -1
  13. package/dist/Prostgles.js.map +1 -1
  14. package/dist/PublishParser.d.ts +37 -37
  15. package/dist/PublishParser.d.ts.map +1 -1
  16. package/dist/PublishParser.js.map +1 -1
  17. package/dist/index.d.ts +2 -3
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js.map +1 -1
  20. package/lib/AuthHandler.d.ts +148 -0
  21. package/lib/AuthHandler.d.ts.map +1 -0
  22. package/lib/AuthHandler.js +411 -0
  23. package/lib/AuthHandler.ts +3 -3
  24. package/lib/DBEventsManager.d.ts +38 -0
  25. package/lib/DBEventsManager.d.ts.map +1 -0
  26. package/lib/DBEventsManager.js +136 -0
  27. package/lib/DBSchemaBuilder.d.ts +11 -0
  28. package/lib/DBSchemaBuilder.d.ts.map +1 -0
  29. package/lib/DBSchemaBuilder.js +102 -0
  30. package/lib/DBSchemaBuilder.ts +62 -27
  31. package/lib/DboBuilder.d.ts +428 -0
  32. package/lib/DboBuilder.d.ts.map +1 -0
  33. package/lib/DboBuilder.js +3078 -0
  34. package/lib/DboBuilder.ts +25 -25
  35. package/lib/FileManager.d.ts +168 -0
  36. package/lib/FileManager.d.ts.map +1 -0
  37. package/lib/FileManager.js +474 -0
  38. package/lib/Filtering.d.ts +15 -0
  39. package/lib/Filtering.d.ts.map +1 -0
  40. package/lib/Filtering.js +299 -0
  41. package/lib/PostgresNotifListenManager.d.ts +27 -0
  42. package/lib/PostgresNotifListenManager.d.ts.map +1 -0
  43. package/lib/PostgresNotifListenManager.js +122 -0
  44. package/lib/Prostgles.d.ts +193 -0
  45. package/lib/Prostgles.d.ts.map +1 -0
  46. package/lib/Prostgles.js +579 -0
  47. package/lib/Prostgles.ts +6 -6
  48. package/lib/PubSubManager.d.ts +157 -0
  49. package/lib/PubSubManager.d.ts.map +1 -0
  50. package/lib/PubSubManager.js +1400 -0
  51. package/lib/PublishParser.d.ts +262 -0
  52. package/lib/PublishParser.d.ts.map +1 -0
  53. package/lib/PublishParser.js +390 -0
  54. package/lib/PublishParser.ts +39 -38
  55. package/lib/QueryBuilder.d.ts +124 -0
  56. package/lib/QueryBuilder.d.ts.map +1 -0
  57. package/lib/QueryBuilder.js +1349 -0
  58. package/lib/SyncReplication.d.ts +34 -0
  59. package/lib/SyncReplication.d.ts.map +1 -0
  60. package/lib/SyncReplication.js +411 -0
  61. package/lib/TableConfig.d.ts +175 -0
  62. package/lib/TableConfig.d.ts.map +1 -0
  63. package/lib/TableConfig.js +231 -0
  64. package/lib/index.d.ts +10 -0
  65. package/lib/index.d.ts.map +1 -0
  66. package/lib/index.js +45 -0
  67. package/lib/index.ts +3 -4
  68. package/lib/shortestPath.d.ts +10 -0
  69. package/lib/shortestPath.d.ts.map +1 -0
  70. package/lib/shortestPath.js +111 -0
  71. package/lib/utils.d.ts +2 -0
  72. package/lib/utils.d.ts.map +1 -0
  73. package/lib/utils.js +5 -0
  74. package/package.json +3 -3
  75. package/tests/client/PID.txt +1 -1
  76. package/tests/client/index.d.ts +1 -1
  77. package/tests/client/index.d.ts.map +1 -1
  78. package/tests/client_only_queries.d.ts +4 -0
  79. package/tests/client_only_queries.d.ts.map +1 -0
  80. package/tests/isomorphic_queries.d.ts +6 -0
  81. package/tests/isomorphic_queries.d.ts.map +1 -0
  82. package/tests/server/DBoGenerated.d.ts +97 -193
  83. package/tests/server/dboTypeCheck.d.ts +2 -0
  84. package/tests/server/dboTypeCheck.d.ts.map +1 -0
  85. package/tests/server/dboTypeCheck.js +14 -0
  86. package/tests/server/dboTypeCheck.ts +17 -0
  87. package/tests/server/index.d.ts +2 -0
  88. package/tests/server/index.d.ts.map +1 -0
  89. package/tests/server/index.js +11 -11
  90. package/tests/server/index.ts +23 -16
  91. package/tests/server/package-lock.json +5 -5
  92. package/tests/server/publishTypeCheck.d.ts +2 -0
  93. package/tests/server/publishTypeCheck.d.ts.map +1 -0
  94. package/tests/server/publishTypeCheck.js +120 -0
  95. package/tests/server/publishTypeCheck.ts +129 -0
  96. package/tests/server/tsconfig.json +4 -5
  97. package/tests/server_only_queries.d.ts +2 -0
  98. package/tests/server_only_queries.d.ts.map +1 -0
@@ -4,18 +4,16 @@
4
4
  /* SCHEMA DEFINITON. Table names have been altered to work with Typescript */
5
5
  /* DBO Definition. Isomorphic */
6
6
 
7
- type DBSchema = {
7
+ export type DBSchemaGenerated = {
8
8
  "\"*\"": {
9
9
  is_view: false;
10
10
  select: true
11
11
  insert: true
12
12
  update: true
13
13
  delete: true
14
- dataTypes: { "\"*\"": string | null; id: number };
15
14
  columns: {
16
- "\"*\"": { type: string; is_nullable: true; is_nullable_or_has_default: true; };
17
-
18
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; }
15
+ "\"*\""?: string | null;
16
+ id?: number
19
17
  }
20
18
  };
21
19
  "*": {
@@ -24,11 +22,9 @@ type DBSchema = {
24
22
  insert: true
25
23
  update: true
26
24
  delete: true
27
- dataTypes: { "*": string | null; id: number };
28
25
  columns: {
29
- "*": { type: string; is_nullable: true; is_nullable_or_has_default: true; };
30
-
31
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; }
26
+ "*"?: string | null;
27
+ id?: number
32
28
  }
33
29
  };
34
30
  ex_j_ins: {
@@ -37,15 +33,11 @@ type DBSchema = {
37
33
  insert: true
38
34
  update: true
39
35
  delete: true
40
- dataTypes: { added: Date | null; id: number; name: string; public: string | null };
41
36
  columns: {
42
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
43
-
44
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
45
-
46
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
47
-
48
- public: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
37
+ added?: Date | null;
38
+ id?: number;
39
+ name: string;
40
+ public?: string | null
49
41
  }
50
42
  };
51
43
  geography_columns: {
@@ -54,21 +46,14 @@ type DBSchema = {
54
46
  insert: true
55
47
  update: true
56
48
  delete: true
57
- dataTypes: { coord_dimension: number | null; f_geography_column: string | null; f_table_catalog: string | null; f_table_name: string | null; f_table_schema: string | null; srid: number | null; type: string | null };
58
49
  columns: {
59
- coord_dimension: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
60
-
61
- f_geography_column: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
62
-
63
- f_table_catalog: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
64
-
65
- f_table_name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
66
-
67
- f_table_schema: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
68
-
69
- srid: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
70
-
71
- type: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
50
+ coord_dimension?: number | null;
51
+ f_geography_column?: string | null;
52
+ f_table_catalog?: string | null;
53
+ f_table_name?: string | null;
54
+ f_table_schema?: string | null;
55
+ srid?: number | null;
56
+ type?: string | null
72
57
  }
73
58
  };
74
59
  geometry_columns: {
@@ -77,21 +62,14 @@ type DBSchema = {
77
62
  insert: true
78
63
  update: true
79
64
  delete: true
80
- dataTypes: { coord_dimension: number | null; f_geometry_column: string | null; f_table_catalog: string | null; f_table_name: string | null; f_table_schema: string | null; srid: number | null; type: string | null };
81
65
  columns: {
82
- coord_dimension: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
83
-
84
- f_geometry_column: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
85
-
86
- f_table_catalog: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
87
-
88
- f_table_name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
89
-
90
- f_table_schema: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
91
-
92
- srid: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
93
-
94
- type: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
66
+ coord_dimension?: number | null;
67
+ f_geometry_column?: string | null;
68
+ f_table_catalog?: string | null;
69
+ f_table_name?: string | null;
70
+ f_table_schema?: string | null;
71
+ srid?: number | null;
72
+ type?: string | null
95
73
  }
96
74
  };
97
75
  insert_rules: {
@@ -100,13 +78,10 @@ type DBSchema = {
100
78
  insert: true
101
79
  update: true
102
80
  delete: true
103
- dataTypes: { added: Date | null; id: number; name: string | null };
104
81
  columns: {
105
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
106
-
107
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
108
-
109
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
82
+ added?: Date | null;
83
+ id?: number;
84
+ name?: string | null
110
85
  }
111
86
  };
112
87
  items: {
@@ -115,13 +90,10 @@ type DBSchema = {
115
90
  insert: true
116
91
  update: true
117
92
  delete: true
118
- dataTypes: { h: Array<string> | null; id: number; name: string | null };
119
93
  columns: {
120
- h: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
121
-
122
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
123
-
124
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
94
+ h?: Array<string> | null;
95
+ id?: number;
96
+ name?: string | null
125
97
  }
126
98
  };
127
99
  items_with_media: {
@@ -130,11 +102,9 @@ type DBSchema = {
130
102
  insert: true
131
103
  update: true
132
104
  delete: true
133
- dataTypes: { id: number; name: string | null };
134
105
  columns: {
135
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
136
-
137
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
106
+ id?: number;
107
+ name?: string | null
138
108
  }
139
109
  };
140
110
  items_with_one_media: {
@@ -143,11 +113,9 @@ type DBSchema = {
143
113
  insert: true
144
114
  update: true
145
115
  delete: true
146
- dataTypes: { id: number; name: string | null };
147
116
  columns: {
148
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
149
-
150
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
117
+ id?: number;
118
+ name?: string | null
151
119
  }
152
120
  };
153
121
  items2: {
@@ -156,15 +124,11 @@ type DBSchema = {
156
124
  insert: true
157
125
  update: true
158
126
  delete: true
159
- dataTypes: { hh: Array<string> | null; id: number; items_id: number | null; name: string | null };
160
127
  columns: {
161
- hh: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
162
-
163
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
164
-
165
- items_id: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
166
-
167
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
128
+ hh?: Array<string> | null;
129
+ id?: number;
130
+ items_id?: number | null;
131
+ name?: string | null
168
132
  }
169
133
  };
170
134
  items3: {
@@ -173,13 +137,10 @@ type DBSchema = {
173
137
  insert: true
174
138
  update: true
175
139
  delete: true
176
- dataTypes: { h: Array<string> | null; id: number; name: string | null };
177
140
  columns: {
178
- h: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
179
-
180
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
181
-
182
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
141
+ h?: Array<string> | null;
142
+ id?: number;
143
+ name?: string | null
183
144
  }
184
145
  };
185
146
  items4: {
@@ -188,15 +149,11 @@ type DBSchema = {
188
149
  insert: true
189
150
  update: true
190
151
  delete: true
191
- dataTypes: { added: Date | null; id: number; name: string; public: string | null };
192
152
  columns: {
193
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
194
-
195
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
196
-
197
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
198
-
199
- public: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
153
+ added?: Date | null;
154
+ id?: number;
155
+ name: string;
156
+ public?: string | null
200
157
  }
201
158
  };
202
159
  items4_pub: {
@@ -205,15 +162,11 @@ type DBSchema = {
205
162
  insert: true
206
163
  update: true
207
164
  delete: true
208
- dataTypes: { added: Date | null; id: number; name: string; public: string | null };
209
165
  columns: {
210
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
211
-
212
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
213
-
214
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
215
-
216
- public: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
166
+ added?: Date | null;
167
+ id?: number;
168
+ name: string;
169
+ public?: string | null
217
170
  }
218
171
  };
219
172
  lookup_col1: {
@@ -222,9 +175,8 @@ type DBSchema = {
222
175
  insert: true
223
176
  update: true
224
177
  delete: true
225
- dataTypes: { id: string };
226
178
  columns: {
227
- id: { type: string; is_nullable: false; is_nullable_or_has_default: false; }
179
+ id: string
228
180
  }
229
181
  };
230
182
  media: {
@@ -233,29 +185,18 @@ type DBSchema = {
233
185
  insert: true
234
186
  update: true
235
187
  delete: true
236
- dataTypes: { content_type: string; description: string | null; etag: string | null; extension: string; id: string; name: string; original_name: string; s3_url: string | null; signed_url: string | null; signed_url_expires: number | null; url: string };
237
188
  columns: {
238
- content_type: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
239
-
240
- description: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
241
-
242
- etag: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
243
-
244
- extension: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
245
-
246
- id: { type: string; is_nullable: false; is_nullable_or_has_default: true; };
247
-
248
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
249
-
250
- original_name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
251
-
252
- s3_url: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
253
-
254
- signed_url: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
255
-
256
- signed_url_expires: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
257
-
258
- url: { type: string; is_nullable: false; is_nullable_or_has_default: false; }
189
+ content_type: string;
190
+ description?: string | null;
191
+ etag?: string | null;
192
+ extension: string;
193
+ id?: string;
194
+ name: string;
195
+ original_name: string;
196
+ s3_url?: string | null;
197
+ signed_url?: string | null;
198
+ signed_url_expires?: number | null;
199
+ url: string
259
200
  }
260
201
  };
261
202
  obj_table: {
@@ -264,11 +205,9 @@ type DBSchema = {
264
205
  insert: true
265
206
  update: true
266
207
  delete: true
267
- dataTypes: { id: number; obj: any | null };
268
208
  columns: {
269
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
270
-
271
- obj: { type: any; is_nullable: true; is_nullable_or_has_default: true; }
209
+ id?: number;
210
+ obj?: any | null
272
211
  }
273
212
  };
274
213
  planes: {
@@ -277,17 +216,12 @@ type DBSchema = {
277
216
  insert: true
278
217
  update: true
279
218
  delete: true
280
- dataTypes: { flight_number: string | null; id: number; last_updated: number; x: number | null; y: number | null };
281
219
  columns: {
282
- flight_number: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
283
-
284
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
285
-
286
- last_updated: { type: number; is_nullable: false; is_nullable_or_has_default: false; };
287
-
288
- x: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
289
-
290
- y: { type: number; is_nullable: true; is_nullable_or_has_default: true; }
220
+ flight_number?: string | null;
221
+ id?: number;
222
+ last_updated: number;
223
+ x?: number | null;
224
+ y?: number | null
291
225
  }
292
226
  };
293
227
  prostgles_lookup_media_items_with_media: {
@@ -296,11 +230,9 @@ type DBSchema = {
296
230
  insert: true
297
231
  update: true
298
232
  delete: true
299
- dataTypes: { foreign_id: number | null; media_id: string };
300
233
  columns: {
301
- foreign_id: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
302
-
303
- media_id: { type: string; is_nullable: false; is_nullable_or_has_default: false; }
234
+ foreign_id?: number | null;
235
+ media_id: string
304
236
  }
305
237
  };
306
238
  prostgles_lookup_media_items_with_one_media: {
@@ -309,11 +241,9 @@ type DBSchema = {
309
241
  insert: true
310
242
  update: true
311
243
  delete: true
312
- dataTypes: { foreign_id: number; media_id: string };
313
244
  columns: {
314
- foreign_id: { type: number; is_nullable: false; is_nullable_or_has_default: false; };
315
-
316
- media_id: { type: string; is_nullable: false; is_nullable_or_has_default: false; }
245
+ foreign_id: number;
246
+ media_id: string
317
247
  }
318
248
  };
319
249
  shapes: {
@@ -322,13 +252,10 @@ type DBSchema = {
322
252
  insert: true
323
253
  update: true
324
254
  delete: true
325
- dataTypes: { geog: any | null; geom: any | null; id: string };
326
255
  columns: {
327
- geog: { type: any; is_nullable: true; is_nullable_or_has_default: true; };
328
-
329
- geom: { type: any; is_nullable: true; is_nullable_or_has_default: true; };
330
-
331
- id: { type: string; is_nullable: false; is_nullable_or_has_default: true; }
256
+ geog?: any | null;
257
+ geom?: any | null;
258
+ id?: string
332
259
  }
333
260
  };
334
261
  spatial_ref_sys: {
@@ -337,17 +264,12 @@ type DBSchema = {
337
264
  insert: true
338
265
  update: true
339
266
  delete: true
340
- dataTypes: { auth_name: string | null; auth_srid: number | null; proj4text: string | null; srid: number; srtext: string | null };
341
267
  columns: {
342
- auth_name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
343
-
344
- auth_srid: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
345
-
346
- proj4text: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
347
-
348
- srid: { type: number; is_nullable: false; is_nullable_or_has_default: false; };
349
-
350
- srtext: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
268
+ auth_name?: string | null;
269
+ auth_srid?: number | null;
270
+ proj4text?: string | null;
271
+ srid: number;
272
+ srtext?: string | null
351
273
  }
352
274
  };
353
275
  tr1: {
@@ -356,11 +278,9 @@ type DBSchema = {
356
278
  insert: true
357
279
  update: true
358
280
  delete: true
359
- dataTypes: { id: number; t1: string | null };
360
281
  columns: {
361
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
362
-
363
- t1: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
282
+ id?: number;
283
+ t1?: string | null
364
284
  }
365
285
  };
366
286
  tr2: {
@@ -369,15 +289,11 @@ type DBSchema = {
369
289
  insert: true
370
290
  update: true
371
291
  delete: true
372
- dataTypes: { id: number; t1: string | null; t2: string | null; tr1_id: number | null };
373
292
  columns: {
374
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
375
-
376
- t1: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
377
-
378
- t2: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
379
-
380
- tr1_id: { type: number; is_nullable: true; is_nullable_or_has_default: true; }
293
+ id?: number;
294
+ t1?: string | null;
295
+ t2?: string | null;
296
+ tr1_id?: number | null
381
297
  }
382
298
  };
383
299
  uuid_text: {
@@ -386,15 +302,11 @@ type DBSchema = {
386
302
  insert: true
387
303
  update: true
388
304
  delete: true
389
- dataTypes: { col1: string | null; col2: string | null; id: string; name: string | null };
390
305
  columns: {
391
- col1: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
392
-
393
- col2: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
394
-
395
- id: { type: string; is_nullable: false; is_nullable_or_has_default: true; };
396
-
397
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
306
+ col1?: string | null;
307
+ col2?: string | null;
308
+ id?: string;
309
+ name?: string | null
398
310
  }
399
311
  };
400
312
  v_items: {
@@ -403,11 +315,9 @@ type DBSchema = {
403
315
  insert: true
404
316
  update: true
405
317
  delete: true
406
- dataTypes: { id: number | null; name: string | null };
407
318
  columns: {
408
- id: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
409
-
410
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
319
+ id?: number | null;
320
+ name?: string | null
411
321
  }
412
322
  };
413
323
  various: {
@@ -416,19 +326,13 @@ type DBSchema = {
416
326
  insert: true
417
327
  update: true
418
328
  delete: true
419
- dataTypes: { added: Date | null; h: Array<string> | null; id: number; jsn: any | null; name: string | null; tsv: any | null };
420
329
  columns: {
421
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
422
-
423
- h: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
424
-
425
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
426
-
427
- jsn: { type: any; is_nullable: true; is_nullable_or_has_default: true; };
428
-
429
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
430
-
431
- tsv: { type: any; is_nullable: true; is_nullable_or_has_default: true; }
330
+ added?: Date | null;
331
+ h?: Array<string> | null;
332
+ id?: number;
333
+ jsn?: any | null;
334
+ name?: string | null;
335
+ tsv?: any | null
432
336
  }
433
337
  };
434
338
 
@@ -0,0 +1,2 @@
1
+ export declare const testDboTypes: () => void;
2
+ //# sourceMappingURL=dboTypeCheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dboTypeCheck.d.ts","sourceRoot":"","sources":["dboTypeCheck.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,YAYxB,CAAA"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.testDboTypes = void 0;
4
+ const testDboTypes = () => {
5
+ (() => {
6
+ const dbo = 1;
7
+ dbo.someTable?.find;
8
+ const dbo1 = 1;
9
+ dbo1.w?.find;
10
+ const db = 1;
11
+ db.items2.find;
12
+ });
13
+ };
14
+ exports.testDboTypes = testDboTypes;
@@ -0,0 +1,17 @@
1
+ import type { DBOFullyTyped } from "../../dist/DBSchemaBuilder";
2
+ import type { DBHandlerServer } from "../../dist/DboBuilder";
3
+ import { DBSchemaGenerated } from "./DBoGenerated";
4
+
5
+ export const testDboTypes = () => {
6
+ (() => {
7
+ const dbo: DBOFullyTyped = 1 as any;
8
+ dbo.someTable?.find;
9
+
10
+ const dbo1: DBHandlerServer = 1 as any;
11
+ dbo1.w?.find;
12
+
13
+
14
+ const db: DBOFullyTyped<DBSchemaGenerated> = 1 as any;
15
+ db.items2.find;
16
+ })
17
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
@@ -45,6 +45,12 @@ const dbConnection = {
45
45
  // user: "usr",
46
46
  // password: "usr",
47
47
  };
48
+ function dd() {
49
+ const dbo = 1;
50
+ if (!dbo)
51
+ return;
52
+ dbo.tbl.find;
53
+ }
48
54
  (async () => {
49
55
  log("created prostgles");
50
56
  const tableConfig = {
@@ -80,6 +86,7 @@ const dbConnection = {
80
86
  }
81
87
  }
82
88
  };
89
+ // ProstglesInitOptions<DBSchemaGenerated>
83
90
  let prgl = await (0, prostgles_server_1.default)({
84
91
  dbConnection,
85
92
  sqlFilePath: path_1.default.join(__dirname + '/init.sql'),
@@ -109,6 +116,8 @@ const dbConnection = {
109
116
  onSocketDisconnect: (socket, db) => {
110
117
  log("onSocketDisconnect");
111
118
  console.trace("onSocketDisconnect");
119
+ // const c: DBOFullyTyped<DBSchemaGenerated> = 1 as any;
120
+ // c["*"].
112
121
  },
113
122
  onSocketConnect: (socket, db) => {
114
123
  log("onSocketConnect");
@@ -187,7 +196,7 @@ const dbConnection = {
187
196
  };
188
197
  },
189
198
  publish: async ({ user }) => {
190
- return {
199
+ const res = {
191
200
  shapes: "*",
192
201
  items: "*",
193
202
  items2: "*",
@@ -261,16 +270,7 @@ const dbConnection = {
261
270
  }
262
271
  }
263
272
  };
264
- // return {
265
- // items: {
266
- // select: {
267
- // fields: "*",
268
- // forcedFilter: {
269
- // $exists: { items3: { name: "a" } }
270
- // }
271
- // }
272
- // }
273
- // };
273
+ return res;
274
274
  },
275
275
  // joins: "inferred",
276
276
  joins: [