prostgles-server 2.0.176 → 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 (100) 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 +51 -7
  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 +2 -2
  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 +91 -23
  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 +29 -29
  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/tsconfig.json +1 -0
  79. package/tests/client_only_queries.d.ts +4 -0
  80. package/tests/client_only_queries.d.ts.map +1 -0
  81. package/tests/isomorphic_queries.d.ts +6 -0
  82. package/tests/isomorphic_queries.d.ts.map +1 -0
  83. package/tests/isomorphic_queries.ts +1 -1
  84. package/tests/server/DBoGenerated.d.ts +97 -196
  85. package/tests/server/dboTypeCheck.d.ts +2 -0
  86. package/tests/server/dboTypeCheck.d.ts.map +1 -0
  87. package/tests/server/dboTypeCheck.js +14 -0
  88. package/tests/server/dboTypeCheck.ts +17 -0
  89. package/tests/server/index.d.ts +2 -0
  90. package/tests/server/index.d.ts.map +1 -0
  91. package/tests/server/index.js +11 -11
  92. package/tests/server/index.ts +23 -16
  93. package/tests/server/package-lock.json +5 -5
  94. package/tests/server/publishTypeCheck.d.ts +2 -0
  95. package/tests/server/publishTypeCheck.d.ts.map +1 -0
  96. package/tests/server/publishTypeCheck.js +120 -0
  97. package/tests/server/publishTypeCheck.ts +129 -0
  98. package/tests/server/tsconfig.json +5 -5
  99. package/tests/server_only_queries.d.ts +2 -0
  100. package/tests/server_only_queries.d.ts.map +1 -0
@@ -3,22 +3,17 @@
3
3
 
4
4
  /* SCHEMA DEFINITON. Table names have been altered to work with Typescript */
5
5
  /* DBO Definition. Isomorphic */
6
- undefined tx: (t: TxCB) => Promise<any | void> ;
7
- };
8
6
 
9
-
10
- type DBSchema = {
7
+ export type DBSchemaGenerated = {
11
8
  "\"*\"": {
12
9
  is_view: false;
13
10
  select: true
14
11
  insert: true
15
12
  update: true
16
13
  delete: true
17
- dataTypes: { "\"*\"": string | null; id: number };
18
14
  columns: {
19
- "\"*\"": { type: string; is_nullable: true; is_nullable_or_has_default: true; };
20
-
21
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; }
15
+ "\"*\""?: string | null;
16
+ id?: number
22
17
  }
23
18
  };
24
19
  "*": {
@@ -27,11 +22,9 @@ type DBSchema = {
27
22
  insert: true
28
23
  update: true
29
24
  delete: true
30
- dataTypes: { "*": string | null; id: number };
31
25
  columns: {
32
- "*": { type: string; is_nullable: true; is_nullable_or_has_default: true; };
33
-
34
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; }
26
+ "*"?: string | null;
27
+ id?: number
35
28
  }
36
29
  };
37
30
  ex_j_ins: {
@@ -40,15 +33,11 @@ type DBSchema = {
40
33
  insert: true
41
34
  update: true
42
35
  delete: true
43
- dataTypes: { added: Date | null; id: number; name: string; public: string | null };
44
36
  columns: {
45
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
46
-
47
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
48
-
49
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
50
-
51
- 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
52
41
  }
53
42
  };
54
43
  geography_columns: {
@@ -57,21 +46,14 @@ type DBSchema = {
57
46
  insert: true
58
47
  update: true
59
48
  delete: true
60
- 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 };
61
49
  columns: {
62
- coord_dimension: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
63
-
64
- f_geography_column: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
65
-
66
- f_table_catalog: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
67
-
68
- f_table_name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
69
-
70
- f_table_schema: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
71
-
72
- srid: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
73
-
74
- 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
75
57
  }
76
58
  };
77
59
  geometry_columns: {
@@ -80,21 +62,14 @@ type DBSchema = {
80
62
  insert: true
81
63
  update: true
82
64
  delete: true
83
- 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 };
84
65
  columns: {
85
- coord_dimension: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
86
-
87
- f_geometry_column: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
88
-
89
- f_table_catalog: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
90
-
91
- f_table_name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
92
-
93
- f_table_schema: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
94
-
95
- srid: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
96
-
97
- 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
98
73
  }
99
74
  };
100
75
  insert_rules: {
@@ -103,13 +78,10 @@ type DBSchema = {
103
78
  insert: true
104
79
  update: true
105
80
  delete: true
106
- dataTypes: { added: Date | null; id: number; name: string | null };
107
81
  columns: {
108
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
109
-
110
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
111
-
112
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
82
+ added?: Date | null;
83
+ id?: number;
84
+ name?: string | null
113
85
  }
114
86
  };
115
87
  items: {
@@ -118,13 +90,10 @@ type DBSchema = {
118
90
  insert: true
119
91
  update: true
120
92
  delete: true
121
- dataTypes: { h: Array<string> | null; id: number; name: string | null };
122
93
  columns: {
123
- h: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
124
-
125
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
126
-
127
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
94
+ h?: Array<string> | null;
95
+ id?: number;
96
+ name?: string | null
128
97
  }
129
98
  };
130
99
  items_with_media: {
@@ -133,11 +102,9 @@ type DBSchema = {
133
102
  insert: true
134
103
  update: true
135
104
  delete: true
136
- dataTypes: { id: number; name: string | null };
137
105
  columns: {
138
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
139
-
140
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
106
+ id?: number;
107
+ name?: string | null
141
108
  }
142
109
  };
143
110
  items_with_one_media: {
@@ -146,11 +113,9 @@ type DBSchema = {
146
113
  insert: true
147
114
  update: true
148
115
  delete: true
149
- dataTypes: { id: number; name: string | null };
150
116
  columns: {
151
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
152
-
153
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
117
+ id?: number;
118
+ name?: string | null
154
119
  }
155
120
  };
156
121
  items2: {
@@ -159,15 +124,11 @@ type DBSchema = {
159
124
  insert: true
160
125
  update: true
161
126
  delete: true
162
- dataTypes: { hh: Array<string> | null; id: number; items_id: number | null; name: string | null };
163
127
  columns: {
164
- hh: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
165
-
166
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
167
-
168
- items_id: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
169
-
170
- 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
171
132
  }
172
133
  };
173
134
  items3: {
@@ -176,13 +137,10 @@ type DBSchema = {
176
137
  insert: true
177
138
  update: true
178
139
  delete: true
179
- dataTypes: { h: Array<string> | null; id: number; name: string | null };
180
140
  columns: {
181
- h: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
182
-
183
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
184
-
185
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
141
+ h?: Array<string> | null;
142
+ id?: number;
143
+ name?: string | null
186
144
  }
187
145
  };
188
146
  items4: {
@@ -191,15 +149,11 @@ type DBSchema = {
191
149
  insert: true
192
150
  update: true
193
151
  delete: true
194
- dataTypes: { added: Date | null; id: number; name: string; public: string | null };
195
152
  columns: {
196
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
197
-
198
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
199
-
200
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
201
-
202
- 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
203
157
  }
204
158
  };
205
159
  items4_pub: {
@@ -208,15 +162,11 @@ type DBSchema = {
208
162
  insert: true
209
163
  update: true
210
164
  delete: true
211
- dataTypes: { added: Date | null; id: number; name: string; public: string | null };
212
165
  columns: {
213
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
214
-
215
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
216
-
217
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
218
-
219
- 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
220
170
  }
221
171
  };
222
172
  lookup_col1: {
@@ -225,9 +175,8 @@ type DBSchema = {
225
175
  insert: true
226
176
  update: true
227
177
  delete: true
228
- dataTypes: { id: string };
229
178
  columns: {
230
- id: { type: string; is_nullable: false; is_nullable_or_has_default: false; }
179
+ id: string
231
180
  }
232
181
  };
233
182
  media: {
@@ -236,29 +185,18 @@ type DBSchema = {
236
185
  insert: true
237
186
  update: true
238
187
  delete: true
239
- 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 };
240
188
  columns: {
241
- content_type: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
242
-
243
- description: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
244
-
245
- etag: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
246
-
247
- extension: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
248
-
249
- id: { type: string; is_nullable: false; is_nullable_or_has_default: true; };
250
-
251
- name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
252
-
253
- original_name: { type: string; is_nullable: false; is_nullable_or_has_default: false; };
254
-
255
- s3_url: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
256
-
257
- signed_url: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
258
-
259
- signed_url_expires: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
260
-
261
- 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
262
200
  }
263
201
  };
264
202
  obj_table: {
@@ -267,11 +205,9 @@ type DBSchema = {
267
205
  insert: true
268
206
  update: true
269
207
  delete: true
270
- dataTypes: { id: number; obj: any | null };
271
208
  columns: {
272
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
273
-
274
- obj: { type: any; is_nullable: true; is_nullable_or_has_default: true; }
209
+ id?: number;
210
+ obj?: any | null
275
211
  }
276
212
  };
277
213
  planes: {
@@ -280,17 +216,12 @@ type DBSchema = {
280
216
  insert: true
281
217
  update: true
282
218
  delete: true
283
- dataTypes: { flight_number: string | null; id: number; last_updated: number; x: number | null; y: number | null };
284
219
  columns: {
285
- flight_number: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
286
-
287
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
288
-
289
- last_updated: { type: number; is_nullable: false; is_nullable_or_has_default: false; };
290
-
291
- x: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
292
-
293
- 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
294
225
  }
295
226
  };
296
227
  prostgles_lookup_media_items_with_media: {
@@ -299,11 +230,9 @@ type DBSchema = {
299
230
  insert: true
300
231
  update: true
301
232
  delete: true
302
- dataTypes: { foreign_id: number | null; media_id: string };
303
233
  columns: {
304
- foreign_id: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
305
-
306
- media_id: { type: string; is_nullable: false; is_nullable_or_has_default: false; }
234
+ foreign_id?: number | null;
235
+ media_id: string
307
236
  }
308
237
  };
309
238
  prostgles_lookup_media_items_with_one_media: {
@@ -312,11 +241,9 @@ type DBSchema = {
312
241
  insert: true
313
242
  update: true
314
243
  delete: true
315
- dataTypes: { foreign_id: number; media_id: string };
316
244
  columns: {
317
- foreign_id: { type: number; is_nullable: false; is_nullable_or_has_default: false; };
318
-
319
- media_id: { type: string; is_nullable: false; is_nullable_or_has_default: false; }
245
+ foreign_id: number;
246
+ media_id: string
320
247
  }
321
248
  };
322
249
  shapes: {
@@ -325,13 +252,10 @@ type DBSchema = {
325
252
  insert: true
326
253
  update: true
327
254
  delete: true
328
- dataTypes: { geog: any | null; geom: any | null; id: string };
329
255
  columns: {
330
- geog: { type: any; is_nullable: true; is_nullable_or_has_default: true; };
331
-
332
- geom: { type: any; is_nullable: true; is_nullable_or_has_default: true; };
333
-
334
- id: { type: string; is_nullable: false; is_nullable_or_has_default: true; }
256
+ geog?: any | null;
257
+ geom?: any | null;
258
+ id?: string
335
259
  }
336
260
  };
337
261
  spatial_ref_sys: {
@@ -340,17 +264,12 @@ type DBSchema = {
340
264
  insert: true
341
265
  update: true
342
266
  delete: true
343
- dataTypes: { auth_name: string | null; auth_srid: number | null; proj4text: string | null; srid: number; srtext: string | null };
344
267
  columns: {
345
- auth_name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
346
-
347
- auth_srid: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
348
-
349
- proj4text: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
350
-
351
- srid: { type: number; is_nullable: false; is_nullable_or_has_default: false; };
352
-
353
- 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
354
273
  }
355
274
  };
356
275
  tr1: {
@@ -359,11 +278,9 @@ type DBSchema = {
359
278
  insert: true
360
279
  update: true
361
280
  delete: true
362
- dataTypes: { id: number; t1: string | null };
363
281
  columns: {
364
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
365
-
366
- t1: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
282
+ id?: number;
283
+ t1?: string | null
367
284
  }
368
285
  };
369
286
  tr2: {
@@ -372,15 +289,11 @@ type DBSchema = {
372
289
  insert: true
373
290
  update: true
374
291
  delete: true
375
- dataTypes: { id: number; t1: string | null; t2: string | null; tr1_id: number | null };
376
292
  columns: {
377
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
378
-
379
- t1: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
380
-
381
- t2: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
382
-
383
- 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
384
297
  }
385
298
  };
386
299
  uuid_text: {
@@ -389,15 +302,11 @@ type DBSchema = {
389
302
  insert: true
390
303
  update: true
391
304
  delete: true
392
- dataTypes: { col1: string | null; col2: string | null; id: string; name: string | null };
393
305
  columns: {
394
- col1: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
395
-
396
- col2: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
397
-
398
- id: { type: string; is_nullable: false; is_nullable_or_has_default: true; };
399
-
400
- 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
401
310
  }
402
311
  };
403
312
  v_items: {
@@ -406,11 +315,9 @@ type DBSchema = {
406
315
  insert: true
407
316
  update: true
408
317
  delete: true
409
- dataTypes: { id: number | null; name: string | null };
410
318
  columns: {
411
- id: { type: number; is_nullable: true; is_nullable_or_has_default: true; };
412
-
413
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; }
319
+ id?: number | null;
320
+ name?: string | null
414
321
  }
415
322
  };
416
323
  various: {
@@ -419,19 +326,13 @@ type DBSchema = {
419
326
  insert: true
420
327
  update: true
421
328
  delete: true
422
- dataTypes: { added: Date | null; h: Array<string> | null; id: number; jsn: any | null; name: string | null; tsv: any | null };
423
329
  columns: {
424
- added: { type: Date; is_nullable: true; is_nullable_or_has_default: true; };
425
-
426
- h: { type: Array<string>; is_nullable: true; is_nullable_or_has_default: true; };
427
-
428
- id: { type: number; is_nullable: false; is_nullable_or_has_default: true; };
429
-
430
- jsn: { type: any; is_nullable: true; is_nullable_or_has_default: true; };
431
-
432
- name: { type: string; is_nullable: true; is_nullable_or_has_default: true; };
433
-
434
- 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
435
336
  }
436
337
  };
437
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: [