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.
Files changed (115) hide show
  1. package/.github/workflows/main.yml +1 -1
  2. package/debug/als-build.log +4 -0
  3. package/debug/als-e2e.log +1747 -0
  4. package/debug/als-lint.log +4 -0
  5. package/debug/als-npm-test.log +712 -0
  6. package/debug/als-row-parts-e2e.log +1759 -0
  7. package/debug/als-row-parts-npm-test.log +716 -0
  8. package/debug/als-typecheck.log +8 -0
  9. package/debug/als-unified-build.log +4 -0
  10. package/debug/als-unified-lint.log +4 -0
  11. package/debug/als-unified-test-build.log +11 -0
  12. package/debug/als-unified-test-server.log +3444 -0
  13. package/debug/inspect-ui-sync.cjs +24 -0
  14. package/debug/subscription-cleanup-repro.log +662 -0
  15. package/debug/subscription-cleanup-trace.log +7230 -0
  16. package/debug/sync-bigint-DBGeneratedSchema.backup +489 -0
  17. package/debug/sync-bigint-build.log +4 -0
  18. package/debug/sync-bigint-client-build.log +0 -0
  19. package/debug/sync-bigint-lint.log +4 -0
  20. package/debug/sync-bigint-server-build.log +0 -0
  21. package/debug/sync-comment-DBGeneratedSchema.backup +489 -0
  22. package/debug/sync-delay-gate-DBGeneratedSchema.backup +489 -0
  23. package/debug/sync-delay-gate-build.log +0 -0
  24. package/debug/sync-diff-review-test.log +132 -0
  25. package/debug/sync-followup-build.log +4 -0
  26. package/debug/sync-notification-before.log +121 -0
  27. package/debug/sync-trigger-cleanup-before.log +134 -0
  28. package/debug/sync-trigger-fix-e2e.log +1758 -0
  29. package/debug/sync-trigger-fix-npm-test.log +1815 -0
  30. package/debug/sync-trigger-lint.log +4 -0
  31. package/debug/trace-subscription-cleanup.cjs +19 -0
  32. package/debug/ui-sync-database-snapshot.log +8 -0
  33. package/debug/ui-sync-investigation.md +30 -0
  34. package/debug/ui-sync-server-tests.log +553 -0
  35. package/dist/Audit/AuditTable.d.ts +1 -1
  36. package/dist/DboBuilder/DboBuilder.d.ts.map +1 -1
  37. package/dist/DboBuilder/DboBuilder.js +4 -2
  38. package/dist/DboBuilder/DboBuilder.js.map +1 -1
  39. package/dist/DboBuilder/DboBuilder.spec.js +3 -1
  40. package/dist/DboBuilder/DboBuilder.spec.js.map +1 -1
  41. package/dist/DboBuilder/TableHandler/TableHandler.d.ts.map +1 -1
  42. package/dist/DboBuilder/TableHandler/TableHandler.js +3 -2
  43. package/dist/DboBuilder/TableHandler/TableHandler.js.map +1 -1
  44. package/dist/DboBuilder/TableHandler/delete.d.ts.map +1 -1
  45. package/dist/DboBuilder/TableHandler/delete.js +4 -3
  46. package/dist/DboBuilder/TableHandler/delete.js.map +1 -1
  47. package/dist/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.d.ts.map +1 -1
  48. package/dist/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.js +7 -6
  49. package/dist/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.js.map +1 -1
  50. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts +1 -1
  51. package/dist/DboBuilder/ViewHandler/ViewHandler.d.ts.map +1 -1
  52. package/dist/DboBuilder/schema/getTablesForSchemaPostgresSQL.d.ts +2 -2
  53. package/dist/ExecutionContext.d.ts +32 -0
  54. package/dist/ExecutionContext.d.ts.map +1 -0
  55. package/dist/ExecutionContext.js +25 -0
  56. package/dist/ExecutionContext.js.map +1 -0
  57. package/dist/JSONBSchemaValidation/validateJSONBSchemaSQL.d.ts +1 -1
  58. package/dist/Prostgles.d.ts +5 -0
  59. package/dist/Prostgles.d.ts.map +1 -1
  60. package/dist/Prostgles.js +5 -0
  61. package/dist/Prostgles.js.map +1 -1
  62. package/dist/PubSubManager/PubSubManager.d.ts +9 -26
  63. package/dist/PubSubManager/PubSubManager.d.ts.map +1 -1
  64. package/dist/PubSubManager/PubSubManager.js +27 -23
  65. package/dist/PubSubManager/PubSubManager.js.map +1 -1
  66. package/dist/PubSubManager/deleteOrphanedTriggers.d.ts.map +1 -1
  67. package/dist/PubSubManager/deleteOrphanedTriggers.js +5 -3
  68. package/dist/PubSubManager/deleteOrphanedTriggers.js.map +1 -1
  69. package/dist/PubSubManager/init/getDataWatchFunctionQuery.d.ts.map +1 -1
  70. package/dist/PubSubManager/init/getDataWatchFunctionQuery.js +1 -2
  71. package/dist/PubSubManager/init/getDataWatchFunctionQuery.js.map +1 -1
  72. package/dist/PubSubManager/init/getPubSubManagerInitQuery.d.ts.map +1 -1
  73. package/dist/PubSubManager/init/getPubSubManagerInitQuery.js +3 -2
  74. package/dist/PubSubManager/init/getPubSubManagerInitQuery.js.map +1 -1
  75. package/dist/PubSubManager/notifListener.js +2 -2
  76. package/dist/PubSubManager/notifListener.js.map +1 -1
  77. package/dist/PubSubManager/refreshTriggers.d.ts.map +1 -1
  78. package/dist/PubSubManager/refreshTriggers.js +5 -3
  79. package/dist/PubSubManager/refreshTriggers.js.map +1 -1
  80. package/dist/PublishParser/PublishParser.d.ts.map +1 -1
  81. package/dist/PublishParser/PublishParser.js +14 -1
  82. package/dist/PublishParser/PublishParser.js.map +1 -1
  83. package/dist/PublishParser/getFunctionRelatedRecords.d.ts +5 -0
  84. package/dist/PublishParser/getFunctionRelatedRecords.d.ts.map +1 -0
  85. package/dist/PublishParser/getFunctionRelatedRecords.js +26 -0
  86. package/dist/PublishParser/getFunctionRelatedRecords.js.map +1 -0
  87. package/dist/index.d.ts +2 -1
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js.map +1 -1
  90. package/dist/initProstgles.d.ts +3 -0
  91. package/dist/initProstgles.d.ts.map +1 -1
  92. package/dist/initProstgles.js +1 -0
  93. package/dist/initProstgles.js.map +1 -1
  94. package/dist/runClientRequest.d.ts.map +1 -1
  95. package/dist/runClientRequest.js +6 -1
  96. package/dist/runClientRequest.js.map +1 -1
  97. package/lib/DboBuilder/DboBuilder.spec.ts +3 -7
  98. package/lib/DboBuilder/DboBuilder.ts +4 -2
  99. package/lib/DboBuilder/TableHandler/TableHandler.ts +14 -11
  100. package/lib/DboBuilder/TableHandler/delete.ts +14 -11
  101. package/lib/DboBuilder/TableHandler/executeAfterHooksCheckAndPostValidation.ts +28 -21
  102. package/lib/ExecutionContext.ts +60 -0
  103. package/lib/Prostgles.ts +8 -4
  104. package/lib/PubSubManager/PubSubManager.ts +31 -28
  105. package/lib/PubSubManager/deleteOrphanedTriggers.ts +5 -3
  106. package/lib/PubSubManager/init/getDataWatchFunctionQuery.ts +1 -2
  107. package/lib/PubSubManager/init/getPubSubManagerInitQuery.ts +3 -2
  108. package/lib/PubSubManager/notifListener.ts +2 -2
  109. package/lib/PubSubManager/refreshTriggers.ts +7 -5
  110. package/lib/PublishParser/PublishParser.ts +17 -1
  111. package/lib/PublishParser/getFunctionRelatedRecords.ts +25 -0
  112. package/lib/index.ts +2 -4
  113. package/lib/initProstgles.ts +5 -4
  114. package/lib/runClientRequest.ts +16 -8
  115. package/package.json +1 -1
@@ -0,0 +1,1815 @@
1
+
2
+ > prostgles-server@4.2.647 test
3
+ > npm run test:lib && npm run test-only
4
+
5
+
6
+ > prostgles-server@4.2.647 test:lib
7
+ > rm -rf ./node_modules/* && rm -rf ./dist/* && npm i && npm run lint -- --ignore-pattern tests && tsc && node --trace-uncaught --test dist/**/*.spec.js
8
+
9
+ npm warn deprecated eslint@9.39.5: This version is no longer supported. Please see https://eslint.org/version-support for other options.
10
+
11
+ > prostgles-server@4.2.647 prepare
12
+ > npm run build
13
+
14
+
15
+ > prostgles-server@4.2.647 build
16
+ > tsc
17
+
18
+
19
+ added 226 packages, and audited 227 packages in 5s
20
+
21
+ 51 packages are looking for funding
22
+ run `npm fund` for details
23
+
24
+ 2 moderate severity vulnerabilities
25
+
26
+ To address all issues (including breaking changes), run:
27
+ npm audit fix --force
28
+
29
+ Run `npm audit` for details.
30
+
31
+ > prostgles-server@4.2.647 lint
32
+ > eslint . --ext .ts --quiet --ignore-pattern tests
33
+
34
+ ▶ DBSchemaBuilder type tests
35
+ ✔ Type checks (0.431959ms)
36
+ ✔ DBSchemaBuilder type tests (0.992193ms)
37
+ ▶ getServerFunctionReturnTypes
38
+ ✔ reads grouped functions and stops at recursive types (1127.715944ms)
39
+ ✔ getServerFunctionReturnTypes (1128.337194ms)
40
+ ▶ DboBuilder onCommit
41
+ ✔ awaits callbacks after commit and logs callback errors (1.508623ms)
42
+ ✔ discards callbacks on rollback (0.428299ms)
43
+ ✔ DboBuilder onCommit (2.57929ms)
44
+ ▶ dboBuilderUtils
45
+ ✔ getErrorAsObject circular (0.768727ms)
46
+ ✔ dboBuilderUtils (1.339795ms)
47
+ ▶ defineFunction type test
48
+ ✔ Type test (1.044577ms)
49
+ ✔ defineFunction type test (2.140026ms)
50
+ ✔ file version rules inherit fields and restrictive select options (3.520462ms)
51
+ ✔ managed files preserve hooks on other tables and append file hooks (0.903923ms)
52
+ ▶ DBOFullyTyped test
53
+ ✔ Type test (0.455197ms)
54
+ ✔ DBOFullyTyped test (1.039478ms)
55
+ ℹ tests 9
56
+ ℹ suites 6
57
+ ℹ pass 9
58
+ ℹ fail 0
59
+ ℹ cancelled 0
60
+ ℹ skipped 0
61
+ ℹ todo 0
62
+ ℹ duration_ms 1388.368509
63
+
64
+ > prostgles-server@4.2.647 test-only
65
+ > cd tests/ && ./test.sh
66
+
67
+
68
+ > prostgles-server@4.2.647 build
69
+ > tsc
70
+
71
+
72
+ > client@1.0.0 build
73
+ > rm -rf ./node_modules/* && rm -rf ./dist/* && npm i && tsc
74
+
75
+ npm warn deprecated whatwg-encoding@3.1.1: Use @exodus/bytes instead for a more spec-conformant and faster implementation
76
+
77
+ added 58 packages, and audited 59 packages in 620ms
78
+
79
+ 7 packages are looking for funding
80
+ run `npm fund` for details
81
+
82
+ found 0 vulnerabilities
83
+
84
+ > client@1.0.0 testBasicHooks
85
+ > node --test dist/client/basicHooks.spec.js
86
+
87
+ ▶ React hooks
88
+ ✔ useAsyncEffectQueue executes the first and debounces the rest (1617.024766ms)
89
+ ✔ useAsyncEffectQueue executes the first and debounces the rest if still mounted (1512.851164ms)
90
+ ✔ React hooks (3130.68805ms)
91
+ ℹ tests 2
92
+ ℹ suites 1
93
+ ℹ pass 2
94
+ ℹ fail 0
95
+ ℹ cancelled 0
96
+ ℹ skipped 0
97
+ ℹ todo 0
98
+ ℹ duration_ms 3412.408406
99
+
100
+ up to date, audited 115 packages in 4s
101
+
102
+ 28 packages are looking for funding
103
+ run `npm fund` for details
104
+
105
+ found 0 vulnerabilities
106
+
107
+ > server_tests@1.0.0 build
108
+ > rm -rf ./node_modules/* && rm -rf ./media/* && rm -rf ./dist/* && npm i && tsc
109
+
110
+
111
+ added 113 packages, and audited 115 packages in 4s
112
+
113
+ 28 packages are looking for funding
114
+ run `npm fund` for details
115
+
116
+ found 0 vulnerabilities
117
+
118
+ > prostgles-server@4.2.647 lint
119
+ > eslint . --ext .ts --quiet
120
+
121
+
122
+ > server_tests@1.0.0 test-server
123
+ > TEST_TYPE=server node --trace-uncaught --test dist/server/index.js
124
+
125
+ Prostgles: SQL file executed successfuly /home/s/prostgles-server-js/tests/server/init.sql
126
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
127
+
128
+ DROP TABLE IF EXISTS "lookup_col1" CASCADE;
129
+ CREATE TABLE IF NOT EXISTS "lookup_col1" (
130
+ id TEXT PRIMARY KEY
131
+ , "description" TEXT
132
+ );
133
+ INSERT INTO "lookup_col1" ("id", "description") VALUES ('a','desc') ON CONFLICT DO NOTHING;
134
+ INSERT INTO "lookup_col1" ("id", "description") VALUES ('b',null) ON CONFLICT DO NOTHING;
135
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
136
+
137
+ CREATE TABLE "files" (
138
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
139
+ "storage_key" UUID UNIQUE ,
140
+ "extension" TEXT NOT NULL DEFAULT '' ,
141
+ "content_type" TEXT NOT NULL DEFAULT '' ,
142
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
143
+ "etag" TEXT NOT NULL DEFAULT '' ,
144
+ "original_name" TEXT NOT NULL ,
145
+ "original_last_modified" TIMESTAMPTZ ,
146
+ "description" TEXT ,
147
+ "url" TEXT NOT NULL DEFAULT '' ,
148
+ "cloud_url" TEXT ,
149
+ "signed_url" TEXT ,
150
+ "signed_url_expires" BIGINT ,
151
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
152
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
153
+ "deleted" TIMESTAMPTZ ,
154
+ "deleted_from_storage" TIMESTAMPTZ ,
155
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex')) ,
156
+ "version" INTEGER NOT NULL DEFAULT 1 ,
157
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files","column":"metadata"}' ))
158
+ );
159
+ CREATE TABLE "files_versions" (
160
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
161
+ "storage_key" UUID NOT NULL ,
162
+ "extension" TEXT NOT NULL DEFAULT '' ,
163
+ "content_type" TEXT NOT NULL DEFAULT '' ,
164
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
165
+ "etag" TEXT NOT NULL DEFAULT '' ,
166
+ "original_name" TEXT NOT NULL ,
167
+ "original_last_modified" TIMESTAMPTZ ,
168
+ "description" TEXT ,
169
+ "url" TEXT NOT NULL DEFAULT '' ,
170
+ "cloud_url" TEXT ,
171
+ "signed_url" TEXT ,
172
+ "signed_url_expires" BIGINT ,
173
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
174
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
175
+ "deleted" TIMESTAMPTZ ,
176
+ "deleted_from_storage" TIMESTAMPTZ ,
177
+ "file_id" UUID NOT NULL ,
178
+ "version" INTEGER NOT NULL ,
179
+ "created" TIMESTAMP NOT NULL DEFAULT NOW() ,
180
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files_versions","column":"metadata"}' ))
181
+ );
182
+ ALTER TABLE "files_versions" ADD CONSTRAINT "prostgles_file_version_e24fec525e76b3433749621f589d35d9" FOREIGN KEY (file_id) REFERENCES "files"(id) ON DELETE CASCADE;
183
+ CREATE UNIQUE INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" ON "files_versions" (file_id, version);
184
+ COMMENT ON INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" IS 'd4af15d064cae99adac0c1194199a9e3';
185
+ CREATE TABLE "users_public_info" (
186
+ "id" SERIAL PRIMARY KEY ,
187
+ "name" TEXT ,
188
+ "avatar" UUID REFERENCES files ON DELETE CASCADE ,
189
+ "sid" TEXT
190
+ );
191
+ DROP TABLE IF EXISTS "users";
192
+ CREATE TABLE "users" (
193
+ "id" SERIAL PRIMARY KEY ,
194
+ "email" TEXT NOT NULL ,
195
+ "status" TEXT NOT NULL CHECK("status" = 'active' OR "status" = 'disabled' OR "status" = 'pending'),
196
+ "type" TEXT NOT NULL ,
197
+ "preferences" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"showIntro":{"type":"boolean","optional":true},"theme":{"enum":["light","dark","auto"],"optional":true},"others":{"type":"any[]"}}}'::TEXT, "preferences", '{"table":"users","column":"preferences"}' ))
198
+ );
199
+ DROP TABLE IF EXISTS "tjson";
200
+ CREATE TABLE "tjson" (
201
+ "json" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"a":{"type":"boolean"},"arr":{"enum":["1","2","3"]},"arr1":{"enum":[1,2,3]},"arr2":{"type":"integer[]"},"arrStr":{"type":"string[]","optional":true,"nullable":true},"o":{"optional":true,"nullable":true,"oneOfType":[{"o1":"integer"},{"o2":"boolean"}]}}}'::TEXT, "json", '{"table":"tjson","column":"json"}' )),
202
+ "colOneOf" TEXT NOT NULL CHECK("colOneOf" = 'a' OR "colOneOf" = 'b' OR "colOneOf" = 'c'),
203
+ "status" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"ok":{"type":"string"}},{"err":{"type":"string"}},{"loading":{"type":{"loaded":{"type":"number"},"total":{"type":"number"}}}}]}'::TEXT, "status", '{"table":"tjson","column":"status"}' )),
204
+ "jsonOneOf" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"command":{"enum":["a"]}},{"command":{"enum":["b"]},"option":{"type":"integer[]"}}]}'::TEXT, "jsonOneOf", '{"table":"tjson","column":"jsonOneOf"}' )),
205
+ "table_config" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"referencedTables":{"optional":true,"arrayOfType":{"name":"string","minFiles":"number"}},"recType":{"nullable":true,"optional":true,"record":{"keysEnum":["a","b"],"values":{"type":{"bools":"boolean[]"}}}}}}'::TEXT, "table_config", '{"table":"tjson","column":"table_config"}' ))
206
+ );
207
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
208
+
209
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col1) REFERENCES lookup_col1(id);
210
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col2) REFERENCES lookup_col1(id);
211
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col3) REFERENCES lookup_col1(id);
212
+ DROP TABLE IF EXISTS "api_table";
213
+ CREATE TABLE "api_table" (
214
+ "id" SERIAL PRIMARY KEY
215
+ );
216
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
217
+ (server): prostgles onReady
218
+ ▶ Server Only Queries
219
+ ✔ column definition row types support SQL aliases, arrays and generated columns (8.612591ms)
220
+ ✔ lookup types propagate through database references while preserving overrides (10.562248ms)
221
+ ✔ lookup types follow FK chains by column and terminate cycles (121.679417ms)
222
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
223
+
224
+ CREATE TABLE "files" (
225
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
226
+ "storage_key" UUID UNIQUE ,
227
+ "extension" TEXT NOT NULL DEFAULT '' ,
228
+ "content_type" TEXT NOT NULL DEFAULT '' ,
229
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
230
+ "etag" TEXT NOT NULL DEFAULT '' ,
231
+ "original_name" TEXT NOT NULL ,
232
+ "original_last_modified" TIMESTAMPTZ ,
233
+ "description" TEXT ,
234
+ "url" TEXT NOT NULL DEFAULT '' ,
235
+ "cloud_url" TEXT ,
236
+ "signed_url" TEXT ,
237
+ "signed_url_expires" BIGINT ,
238
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
239
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
240
+ "deleted" TIMESTAMPTZ ,
241
+ "deleted_from_storage" TIMESTAMPTZ ,
242
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex'))
243
+ );
244
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
245
+ Prostgles: Created typescript schema definition file:
246
+ DBGeneratedSchema.ts
247
+ Prostgles: Created typescript schema definition file:
248
+ DBGeneratedSchema.ts
249
+ ▶ client publish profiles compile at startup and follow user types
250
+ ✔ server user handlers enforce permissions and reject client impersonation (39.92967ms)
251
+ ✔ a rejected guest abort cannot cancel a later server-user query (3.036187ms)
252
+ ✔ caught subscription errors still roll back client transactions (4.840142ms)
253
+ ✔ caught checkFilter errors still roll back client transactions (13.368269ms)
254
+ ✔ caught postValidate errors still roll back client transactions (4.481847ms)
255
+ No options changed
256
+ Prostgles: Created typescript schema definition file:
257
+ DBGeneratedSchema.ts
258
+ Prostgles: Created typescript schema definition file:
259
+ DBGeneratedSchema.ts
260
+ Prostgles: Created typescript schema definition file:
261
+ DBGeneratedSchema.ts
262
+ Prostgles: Created typescript schema definition file:
263
+ DBGeneratedSchema.ts
264
+ destroying prgl instance
265
+ ✔ server user handlers require configured authentication (0.770517ms)
266
+ ✔ client publish profiles compile at startup and follow user types (2000.462406ms)
267
+ ▶ Managed storage permission and transaction safety
268
+ ✔ legacy ID-based files remain readable and replaceable (29.7927ms)
269
+ ✔ custom columns do not require or interfere with file data (27.379772ms)
270
+ ✔ filtered updates and failed validation preserve storage (9.871717ms)
271
+ ✔ failed uploads and application hooks leave no replacement objects (27.221625ms)
272
+ ✔ duplicate IDs, conflict updates and SQL-only requests cannot overwrite (23.679274ms)
273
+ ✔ PostgreSQL update policies are enforced before uploading (6.450248ms)
274
+ ✔ RLS-hidden references fail closed during storage cleanup (2.813632ms)
275
+ ✔ beforeEach lifecycle callbacks follow the outer transaction (27.572028ms)
276
+ ✔ outer rollback preserves replaced and deleted objects (24.267605ms)
277
+ ✔ a failed multi-insert waits for other uploads before cleanup (4.620425ms)
278
+ ✔ concurrent replacements leave one complete referenced object (22.319931ms)
279
+ ✔ version retention removes only unreferenced objects (42.350294ms)
280
+ ✔ foreign-key failure preserves bytes and deletion waits for commit (16.983591ms)
281
+ ✔ cloud downloads and cleanup use the committed storage key (50.413885ms)
282
+ ✔ Managed storage permission and transaction safety (340.114923ms)
283
+ destroying prgl instance
284
+ destroying prgl instance
285
+ ✔ custom joins add conditions unless override is requested (2298.96947ms)
286
+ destroying prgl instance
287
+ ✔ custom self joins use configured paths and override inferred joins (1150.426616ms)
288
+ destroying prgl instance
289
+ destroying prgl instance
290
+ destroying prgl instance
291
+ ✔ destroy allows reusing Socket.IO on a running HTTP server (3323.075773ms)
292
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
293
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
294
+
295
+ CREATE TABLE "audit_events" (
296
+ "id" BIGSERIAL PRIMARY KEY ,
297
+ "created_at" TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp() ,
298
+ "schema_name" TEXT NOT NULL ,
299
+ "table_name" TEXT NOT NULL ,
300
+ "operation" TEXT NOT NULL CHECK("operation" = 'INSERT' OR "operation" = 'UPDATE' OR "operation" = 'DELETE'),
301
+ "old_id" JSONB ,
302
+ "new_id" JSONB ,
303
+ "old_row" JSONB ,
304
+ "new_row" JSONB ,
305
+ "actor" JSONB ,
306
+ "db_context" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"transaction_id":"string","transaction_started_at":"string","statement_started_at":"string","current_role":"string","session_user":"string","application_name":"string"}}'::TEXT, "db_context", '{"table":"audit_events","column":"db_context"}' ))
307
+ );
308
+ CREATE TABLE "audit_test_files" (
309
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
310
+ "storage_key" UUID UNIQUE ,
311
+ "extension" TEXT NOT NULL DEFAULT '' ,
312
+ "content_type" TEXT NOT NULL DEFAULT '' ,
313
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
314
+ "etag" TEXT NOT NULL DEFAULT '' ,
315
+ "original_name" TEXT NOT NULL ,
316
+ "original_last_modified" TIMESTAMPTZ ,
317
+ "description" TEXT ,
318
+ "url" TEXT NOT NULL DEFAULT '' ,
319
+ "cloud_url" TEXT ,
320
+ "signed_url" TEXT ,
321
+ "signed_url_expires" BIGINT ,
322
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
323
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
324
+ "deleted" TIMESTAMPTZ ,
325
+ "deleted_from_storage" TIMESTAMPTZ ,
326
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex'))
327
+ );
328
+ CREATE TABLE "audit_test_source" (
329
+ "a" int NOT NULL ,
330
+ "b" text NOT NULL ,
331
+ "value" text ,
332
+ "secret" text
333
+ );
334
+ ALTER TABLE "audit_test_source" ADD PRIMARY KEY (a, b);
335
+ CREATE TABLE "audit_test_documents" (
336
+ "id" serial PRIMARY KEY ,
337
+ "file_id" uuid NOT NULL REFERENCES audit_test_files(id)
338
+ );
339
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
340
+ IO missing. Publish has no effect without io or restApi
341
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
342
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
343
+ IO missing. Publish has no effect without io or restApi
344
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
345
+ IO missing. Publish has no effect without io or restApi
346
+ destroying prgl instance
347
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
348
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
349
+ IO missing. Publish has no effect without io or restApi
350
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
351
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
352
+ IO missing. Publish has no effect without io or restApi
353
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
354
+ Trace: Error: audit.tables cannot mix enabled and disabled entries
355
+ at parseAuditConfig (/home/s/prostgles-server-js/dist/Audit/parseAuditConfig.js:19:15)
356
+ at get resolvedAuditConfig (/home/s/prostgles-server-js/dist/Prostgles.js:135:56)
357
+ at get mergedTableConfig (/home/s/prostgles-server-js/dist/Prostgles.js:147:28)
358
+ at syncTableTriggers (/home/s/prostgles-server-js/dist/TableConfig/syncTableTriggers.js:8:25)
359
+ at /home/s/prostgles-server-js/dist/initProstgles.js:99:61
360
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
361
+ at Prostgles.initProstgles (/home/s/prostgles-server-js/dist/initProstgles.js:198:17)
362
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
363
+ at async waitForActual (node:assert:646:5)
364
+ at async strict.rejects (node:assert:769:25)
365
+ at async TestContext.<anonymous> (/home/s/prostgles-server-js/tests/server/dist/server/audit.spec.js:485:17)
366
+ at async Test.run (node:internal/test_runner/test:1125:7)
367
+ at async Suite.processPendingSubtests (node:internal/test_runner/test:787:7)
368
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
369
+ Trace: Error: Unknown audit table: missing_table
370
+ at parseAuditConfig (/home/s/prostgles-server-js/dist/Audit/parseAuditConfig.js:23:19)
371
+ at get resolvedAuditConfig (/home/s/prostgles-server-js/dist/Prostgles.js:135:56)
372
+ at get mergedTableConfig (/home/s/prostgles-server-js/dist/Prostgles.js:147:28)
373
+ at syncTableTriggers (/home/s/prostgles-server-js/dist/TableConfig/syncTableTriggers.js:8:25)
374
+ at /home/s/prostgles-server-js/dist/initProstgles.js:99:61
375
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
376
+ at Prostgles.initProstgles (/home/s/prostgles-server-js/dist/initProstgles.js:198:17)
377
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
378
+ at async waitForActual (node:assert:646:5)
379
+ at async strict.rejects (node:assert:769:25)
380
+ at async TestContext.<anonymous> (/home/s/prostgles-server-js/tests/server/dist/server/audit.spec.js:485:17)
381
+ at async Test.run (node:internal/test_runner/test:1125:7)
382
+ at async Suite.processPendingSubtests (node:internal/test_runner/test:787:7)
383
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
384
+ Trace: Error: audit.idColumns is required for audit_test_nopk without a primary key
385
+ at parseAuditConfig (/home/s/prostgles-server-js/dist/Audit/parseAuditConfig.js:45:19)
386
+ at get resolvedAuditConfig (/home/s/prostgles-server-js/dist/Prostgles.js:135:56)
387
+ at get mergedTableConfig (/home/s/prostgles-server-js/dist/Prostgles.js:147:28)
388
+ at syncTableTriggers (/home/s/prostgles-server-js/dist/TableConfig/syncTableTriggers.js:8:25)
389
+ at /home/s/prostgles-server-js/dist/initProstgles.js:99:61
390
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
391
+ at Prostgles.initProstgles (/home/s/prostgles-server-js/dist/initProstgles.js:198:17)
392
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
393
+ at async waitForActual (node:assert:646:5)
394
+ at async strict.rejects (node:assert:769:25)
395
+ at async TestContext.<anonymous> (/home/s/prostgles-server-js/tests/server/dist/server/audit.spec.js:485:17)
396
+ at async Test.run (node:internal/test_runner/test:1125:7)
397
+ at async Suite.processPendingSubtests (node:internal/test_runner/test:787:7)
398
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
399
+ Trace: Error: Unsupported audit target: audit_test_view
400
+ at parseAuditConfig (/home/s/prostgles-server-js/dist/Audit/parseAuditConfig.js:37:23)
401
+ at get resolvedAuditConfig (/home/s/prostgles-server-js/dist/Prostgles.js:135:56)
402
+ at get mergedTableConfig (/home/s/prostgles-server-js/dist/Prostgles.js:147:28)
403
+ at syncTableTriggers (/home/s/prostgles-server-js/dist/TableConfig/syncTableTriggers.js:8:25)
404
+ at /home/s/prostgles-server-js/dist/initProstgles.js:99:61
405
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
406
+ at Prostgles.initProstgles (/home/s/prostgles-server-js/dist/initProstgles.js:198:17)
407
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
408
+ at async waitForActual (node:assert:646:5)
409
+ at async strict.rejects (node:assert:769:25)
410
+ at async TestContext.<anonymous> (/home/s/prostgles-server-js/tests/server/dist/server/audit.spec.js:485:17)
411
+ at async Test.run (node:internal/test_runner/test:1125:7)
412
+ at async Suite.processPendingSubtests (node:internal/test_runner/test:787:7)
413
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
414
+ Trace: Error: Audit identity columns cannot be excluded: audit_test_source
415
+ at parseAuditConfig (/home/s/prostgles-server-js/dist/Audit/parseAuditConfig.js:54:19)
416
+ at get resolvedAuditConfig (/home/s/prostgles-server-js/dist/Prostgles.js:135:56)
417
+ at get mergedTableConfig (/home/s/prostgles-server-js/dist/Prostgles.js:147:28)
418
+ at syncTableTriggers (/home/s/prostgles-server-js/dist/TableConfig/syncTableTriggers.js:8:25)
419
+ at /home/s/prostgles-server-js/dist/initProstgles.js:99:61
420
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
421
+ at Prostgles.initProstgles (/home/s/prostgles-server-js/dist/initProstgles.js:198:17)
422
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
423
+ at async waitForActual (node:assert:646:5)
424
+ at async strict.rejects (node:assert:769:25)
425
+ at async TestContext.<anonymous> (/home/s/prostgles-server-js/tests/server/dist/server/audit.spec.js:485:17)
426
+ at async Test.run (node:internal/test_runner/test:1125:7)
427
+ at async Suite.processPendingSubtests (node:internal/test_runner/test:787:7)
428
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
429
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
430
+ IO missing. Publish has no effect without io or restApi
431
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
432
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
433
+ IO missing. Publish has no effect without io or restApi
434
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
435
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
436
+ IO missing. Publish has no effect without io or restApi
437
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
438
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
439
+ IO missing. Publish has no effect without io or restApi
440
+ Prostgles: SQL file executed successfuly /tmp/prostgles-audit-EJN9GI/init.sql
441
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
442
+ IO missing. Publish has no effect without io or restApi
443
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
444
+ IO missing. Publish has no effect without io or restApi
445
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
446
+ IO missing. Publish has no effect without io or restApi
447
+ Trace: Error: audit.idColumns is required for audit_test_nopk without a primary key
448
+ at parseAuditConfig (/home/s/prostgles-server-js/dist/Audit/parseAuditConfig.js:45:19)
449
+ at get resolvedAuditConfig (/home/s/prostgles-server-js/dist/Prostgles.js:135:56)
450
+ at get mergedTableConfig (/home/s/prostgles-server-js/dist/Prostgles.js:147:28)
451
+ at syncTableTriggers (/home/s/prostgles-server-js/dist/TableConfig/syncTableTriggers.js:8:25)
452
+ at /home/s/prostgles-server-js/dist/initProstgles.js:99:61
453
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
454
+ at Prostgles.initProstgles (/home/s/prostgles-server-js/dist/initProstgles.js:198:17)
455
+ at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
456
+ at async updateConfiguration (/home/s/prostgles-server-js/dist/updateConfiguration.js:58:9)
457
+ at async Object.update (/home/s/prostgles-server-js/dist/initProstgles.js:162:17)
458
+ at async waitForActual (node:assert:646:5)
459
+ at async strict.rejects (node:assert:769:25)
460
+ at async TestContext.<anonymous> (/home/s/prostgles-server-js/tests/server/dist/server/audit.spec.js:535:13)
461
+ at async Test.run (node:internal/test_runner/test:1125:7)
462
+ at async Suite.processPendingSubtests (node:internal/test_runner/test:787:7)
463
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
464
+ IO missing. Publish has no effect without io or restApi
465
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
466
+
467
+ CREATE TABLE "audit_next_events" (
468
+ "id" BIGSERIAL PRIMARY KEY ,
469
+ "created_at" TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp() ,
470
+ "schema_name" TEXT NOT NULL ,
471
+ "table_name" TEXT NOT NULL ,
472
+ "operation" TEXT NOT NULL CHECK("operation" = 'INSERT' OR "operation" = 'UPDATE' OR "operation" = 'DELETE'),
473
+ "old_id" JSONB ,
474
+ "new_id" JSONB ,
475
+ "old_row" JSONB ,
476
+ "new_row" JSONB ,
477
+ "actor" JSONB ,
478
+ "db_context" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"transaction_id":"string","transaction_started_at":"string","statement_started_at":"string","current_role":"string","session_user":"string","application_name":"string"}}'::TEXT, "db_context", '{"table":"audit_next_events","column":"db_context"}' ))
479
+ );
480
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
481
+ IO missing. Publish has no effect without io or restApi
482
+ destroying prgl instance
483
+ ✔ Managed audit setup, row history, protection, access and query readiness (7638.117172ms)
484
+ ✔ getJSONBSchemaValidationErrorAsync with real db handlers (2.597393ms)
485
+ ✔ Parallel subscription at init causing crash in getPubSubManager: duplicate key value violates unique constraint "apps_pkey" (101.1978ms)
486
+ ✔ RLS context is isolated across implicit transactions, commit, rollback and pool reuse (10.594188ms)
487
+ ✔ subscription and sync reads isolate users with a real RLS policy (9.227361ms)
488
+ ✔ ordinary beforeEach hooks transform inputs before validation (34.98095ms)
489
+ ✔ multi false is checked after beforeEach and rolls back the update (12.966065ms)
490
+ ✔ ordinary beforeEach hooks run before PostgreSQL UPDATE policy checks (11.718935ms)
491
+ ✔ before and after hooks preserve RLS across dbx and raw tx calls (13.766574ms)
492
+ ▶ post-transaction hooks receive committed and authenticated context
493
+ ✔ afterCommit runs after commit, filters changed fields and skips rollback (10.382763ms)
494
+ ✔ clearing a watched field runs before, after and commit hooks (2.843142ms)
495
+ ✔ client updateBatch runs hooks atomically in implicit and explicit transactions (15.269898ms)
496
+ destroying prgl instance
497
+ ✔ server-user requests preserve tenant_id from sessionFields (1.124689ms)
498
+ ✔ post-transaction hooks receive committed and authenticated context (1171.244876ms)
499
+ ✔ Self reference recursion bug (1.601738ms)
500
+ ✔ Transactions (9.619762ms)
501
+ (server): Server-only query tests successful
502
+ (server): Starting isomorphic queries
503
+ ✔ TableConfig onMount works (3.08783ms)
504
+ ✔ Server Only Queries (18276.294941ms)
505
+ (server): DELETING items
506
+ ▶ Isomorphic queries
507
+ ✔ Deleting stale data (31.785939ms)
508
+ ✔ Error structure malformed array literal (11.805703ms)
509
+ ✔ Table info (0.322201ms)
510
+ ✔ Prepare data (31.37419ms)
511
+ ✔ Test bytea (2.7861ms)
512
+ ✔ abortSignal terminates a running query (5524.782212ms)
513
+ ✔ Client queries are aborted no more than after n seconds (0.321755ms)
514
+ ✔ Subscription tracked_columns get merged correctly (22.705695ms)
515
+ ✔ Aggregate subscription tracks FILTER and ORDER BY dependencies (931.658048ms)
516
+ ✔ CASE select and subscription dependencies (624.541642ms)
517
+ ✔ Subscription tracks non-selected ORDER BY columns (622.65855ms)
518
+ ✔ merge json (5.388363ms)
519
+ ✔ json array converted to pg array filter bug (0.811707ms)
520
+ ✔ onConflict do update (4.28854ms)
521
+ ✔ Local file upload (26.392804ms)
522
+ ✔ Local file delete (16.826579ms)
523
+ ✔ Local file update (19.729819ms)
524
+ ✔ getColumns definition (0.574135ms)
525
+ ✔ returnType (0.228102ms)
526
+ ✔ Table config triggers (4.170143ms)
527
+ ✔ $unnest_words (0.764385ms)
528
+ ✔ Group by/Distinct (0.979247ms)
529
+ ✔ sql returntype default-with-rollback (16.856169ms)
530
+ ✔ returnType: value (1.213969ms)
531
+ ✔ PostgreSQL array element (4.900165ms)
532
+ ✔ FTS filtering (4.599097ms)
533
+ ✔ $term_highlight (3.3026ms)
534
+ ✔ funcFilters: $term_highlight (1.527572ms)
535
+ (server): [{"name":null}]
536
+ (server): [{"name":"zz3zz1"}]
537
+ (server): []
538
+ ✔ subscribe skipChangedColumnsCheck false by default = sub should not fire if selected data did not change (832.829716ms)
539
+ (server): [{"name":"zz3zz1"}]
540
+ (server): [{"name":"zz3zz1"}]
541
+ (server): [{"name":"zz3zz1"}]
542
+ (server): [{"name":"zz3zz1"}]
543
+ (server): []
544
+ ✔ subscribe skipChangedColumnsCheck true (3358.840247ms)
545
+ unsubscribe start - various
546
+ unsubscribe end - various
547
+ ✔ subscribe (33.039441ms)
548
+ ✔ subscribe to schema.table (16.310064ms)
549
+ ✔ parallel subscriptions (2020.060067ms)
550
+ (server): updateAll done in 1653
551
+ (server): updateAll done in 1530
552
+ (server): updateAll done in 1842
553
+ ✔ subscriptions do not serialize transactions (9543.438812ms)
554
+ Created PubSubManager
555
+ throttling sub for 1700 ms
556
+ ✔ subscribeOne with throttle (1721.42489ms)
557
+ throttling finished. pushSubData...
558
+ throttling sub for 1700 ms
559
+ ✔ subscribeOne with throttle skipFirst: true (1707.401416ms)
560
+ ✔ subscribeOne without skipFirst (1055.919951ms)
561
+ ✔ subscribeOne with skipFirst: true (1520.252293ms)
562
+ ✔ subscribeOne actions: { insert: true } (1542.740128ms)
563
+ ✔ subscribeOne actions: { insert: false } (1544.874325ms)
564
+ ✔ JSON filtering (2.264233ms)
565
+ ✔ Complex filtering (2.502883ms)
566
+ ✔ template_string function (2.520682ms)
567
+ ✔ Between filtering (2.873602ms)
568
+ ✔ In filtering (1.890601ms)
569
+ ✔ Order by (2.468048ms)
570
+ ✔ Order by aliased func (1.373452ms)
571
+ ✔ Filter by aliased func (1.285313ms)
572
+ ✔ Count with Filter by aliased func (1.805836ms)
573
+ ✔ Count with Aggregate and Filter by aliased func (1.453622ms)
574
+ ✔ Count with complex filter (1.376576ms)
575
+ ✔ Order by aggregation (0.840048ms)
576
+ ✔ Aggregate FILTER and ORDER BY (0.903693ms)
577
+ ✔ Column alias func (0.858415ms)
578
+ ✔ Order by colliding alias name (0.848998ms)
579
+ ✔ Update batch example (4.181413ms)
580
+ TODO: socket.io stringifies dates
581
+ ✔ Function example (10.764294ms)
582
+ ✔ JSONB filtering (4.5932ms)
583
+ ✔ Postgis examples (6.639389ms)
584
+ ✔ jsonbSchema validation (6.521869ms)
585
+ ✔ find and findOne (0.784776ms)
586
+ ✔ Result size (1.024311ms)
587
+ ✔ Basic exists (1.136767ms)
588
+ ✔ Basic fts with shorthand notation (1.775131ms)
589
+ ✔ Exists with shortest path wildcard filter example (1.31757ms)
590
+ ✔ Exists with exact path filter example (1.001922ms)
591
+ ✔ Not Exists with exact path filter example (1.29095ms)
592
+ ✔ Upsert example (9.882227ms)
593
+ ✔ Joins example (1.487331ms)
594
+ ✔ Joins repeating table example (1.89793ms)
595
+ ✔ Join aggregate functions example (5.558668ms)
596
+ ✔ $rowhash example (19.914389ms)
597
+ ✔ Reference column nested insert (7.741846ms)
598
+ ✔ Join escaped table names with quotes (24.997301ms)
599
+ (server): {
600
+ "item": {
601
+ "\"id0\"": 1,
602
+ "\"quoted1_id\"": 1,
603
+ "\"text_col0\"": "0"
604
+ },
605
+ "runs": 0
606
+ }
607
+ (server): {
608
+ "item": {
609
+ "\"id0\"": 1,
610
+ "\"quoted1_id\"": 1,
611
+ "\"text_col0\"": "1"
612
+ },
613
+ "runs": 1
614
+ }
615
+ unsubscribe start - """quoted0"""
616
+ unsubscribe end - """quoted0"""
617
+ ✔ subscribe to escaped table name (13.453966ms)
618
+ ✔ subscribe using a filter bigger than block_size (17.195768ms)
619
+ ✔ Reverse join with agg (8.912464ms)
620
+ {
621
+ _rows: [
622
+ { id: 1, t1: null, tr2: [Array], tr3: [] },
623
+ { id: 2, t1: null, tr2: [Array], tr3: [] }
624
+ ],
625
+ runs: 1
626
+ }
627
+ {
628
+ _rows: [
629
+ { id: 1, t1: null, tr2: [Array], tr3: [] },
630
+ { id: 2, t1: null, tr2: [Array], tr3: [] }
631
+ ],
632
+ runs: 2
633
+ }
634
+ ✔ Related table subscribe (9023.732937ms)
635
+ ✔ Aggregate FILTER registers joined dependency triggers (644.864531ms)
636
+ ✔ Nested sort by computed col (7.41076ms)
637
+ ✔ Nested function on different than source column getNewQuery name bug fix (2.157461ms)
638
+ ✔ Reference column deep nested insert (13.907043ms)
639
+ ✔ Multi reference column nested insert (14.699513ms)
640
+ ✔ Join path with order by nested (8.278627ms)
641
+ ✔ Self join (14.385495ms)
642
+ ✔ One to many multi join duplicate row bug fix (13.193272ms)
643
+ (server): various id=99 count
644
+ (server): various id=99 count
645
+ ok
646
+ (server): various id=99 count
647
+ (server): Error in subscription callback: {"message":"column prostgles_root_table_alias.name does not exist","length":130,"name":"error","severity":"ERROR","code":"42703","position":"107","file":"parse_relation.c","line":"3665","routine":"errorMissingColumn","query":"-- prostgles query id: 3714a342-c865-48d3-8b89-151f471b63fd\nSET LOCAL \"prostgles.user\" \nTO '';\nSELECT \n \"prostgles_root_table_alias\".\"name\" AS \"name\" \n FROM ( \n SELECT * \n FROM various \n WHERE \"id\" = 99 \n ) prostgles_root_table_alias \n LIMIT 1000","code_info":"undefined_column"}
648
+ ok
649
+ ✔ subscribe triggers with stale schema should fail gracefully and never block other queries (6525.552069ms)
650
+ ✔ Isomorphic queries (49263.927365ms)
651
+ ✔ Having clause (1.256247ms)
652
+ ✔ Having clause with complex filter (0.832264ms)
653
+ (server): Server isomorphic tests successful
654
+ (server): Stopping server ...
655
+ ℹ tests 134
656
+ ℹ suites 2
657
+ ℹ pass 134
658
+ ℹ fail 0
659
+ ℹ cancelled 0
660
+ ℹ skipped 0
661
+ ℹ todo 0
662
+ ℹ duration_ms 73436.717017
663
+
664
+ > server_tests@1.0.0 test-client
665
+ > TEST_TYPE=client node --trace-uncaught --test dist/server/index.js
666
+
667
+ Prostgles: SQL file executed successfuly /home/s/prostgles-server-js/tests/server/init.sql
668
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
669
+
670
+ DROP TABLE IF EXISTS "lookup_col1" CASCADE;
671
+ CREATE TABLE IF NOT EXISTS "lookup_col1" (
672
+ id TEXT PRIMARY KEY
673
+ , "description" TEXT
674
+ );
675
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
676
+
677
+ CREATE TABLE "files" (
678
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
679
+ "storage_key" UUID UNIQUE ,
680
+ "extension" TEXT NOT NULL DEFAULT '' ,
681
+ "content_type" TEXT NOT NULL DEFAULT '' ,
682
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
683
+ "etag" TEXT NOT NULL DEFAULT '' ,
684
+ "original_name" TEXT NOT NULL ,
685
+ "original_last_modified" TIMESTAMPTZ ,
686
+ "description" TEXT ,
687
+ "url" TEXT NOT NULL DEFAULT '' ,
688
+ "cloud_url" TEXT ,
689
+ "signed_url" TEXT ,
690
+ "signed_url_expires" BIGINT ,
691
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
692
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
693
+ "deleted" TIMESTAMPTZ ,
694
+ "deleted_from_storage" TIMESTAMPTZ ,
695
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex')) ,
696
+ "version" INTEGER NOT NULL DEFAULT 1 ,
697
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files","column":"metadata"}' ))
698
+ );
699
+ CREATE TABLE "files_versions" (
700
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
701
+ "storage_key" UUID NOT NULL ,
702
+ "extension" TEXT NOT NULL DEFAULT '' ,
703
+ "content_type" TEXT NOT NULL DEFAULT '' ,
704
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
705
+ "etag" TEXT NOT NULL DEFAULT '' ,
706
+ "original_name" TEXT NOT NULL ,
707
+ "original_last_modified" TIMESTAMPTZ ,
708
+ "description" TEXT ,
709
+ "url" TEXT NOT NULL DEFAULT '' ,
710
+ "cloud_url" TEXT ,
711
+ "signed_url" TEXT ,
712
+ "signed_url_expires" BIGINT ,
713
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
714
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
715
+ "deleted" TIMESTAMPTZ ,
716
+ "deleted_from_storage" TIMESTAMPTZ ,
717
+ "file_id" UUID NOT NULL ,
718
+ "version" INTEGER NOT NULL ,
719
+ "created" TIMESTAMP NOT NULL DEFAULT NOW() ,
720
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files_versions","column":"metadata"}' ))
721
+ );
722
+ ALTER TABLE "files_versions" ADD CONSTRAINT "prostgles_file_version_e24fec525e76b3433749621f589d35d9" FOREIGN KEY (file_id) REFERENCES "files"(id) ON DELETE CASCADE;
723
+ CREATE UNIQUE INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" ON "files_versions" (file_id, version);
724
+ COMMENT ON INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" IS 'd4af15d064cae99adac0c1194199a9e3';
725
+ CREATE TABLE "users_public_info" (
726
+ "id" SERIAL PRIMARY KEY ,
727
+ "name" TEXT ,
728
+ "avatar" UUID REFERENCES files ON DELETE CASCADE ,
729
+ "sid" TEXT
730
+ );
731
+ DROP TABLE IF EXISTS "users";
732
+ CREATE TABLE "users" (
733
+ "id" SERIAL PRIMARY KEY ,
734
+ "email" TEXT NOT NULL ,
735
+ "status" TEXT NOT NULL CHECK("status" = 'active' OR "status" = 'disabled' OR "status" = 'pending'),
736
+ "type" TEXT NOT NULL ,
737
+ "preferences" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"showIntro":{"type":"boolean","optional":true},"theme":{"enum":["light","dark","auto"],"optional":true},"others":{"type":"any[]"}}}'::TEXT, "preferences", '{"table":"users","column":"preferences"}' ))
738
+ );
739
+ DROP TABLE IF EXISTS "tjson";
740
+ CREATE TABLE "tjson" (
741
+ "json" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"a":{"type":"boolean"},"arr":{"enum":["1","2","3"]},"arr1":{"enum":[1,2,3]},"arr2":{"type":"integer[]"},"arrStr":{"type":"string[]","optional":true,"nullable":true},"o":{"optional":true,"nullable":true,"oneOfType":[{"o1":"integer"},{"o2":"boolean"}]}}}'::TEXT, "json", '{"table":"tjson","column":"json"}' )),
742
+ "colOneOf" TEXT NOT NULL CHECK("colOneOf" = 'a' OR "colOneOf" = 'b' OR "colOneOf" = 'c'),
743
+ "status" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"ok":{"type":"string"}},{"err":{"type":"string"}},{"loading":{"type":{"loaded":{"type":"number"},"total":{"type":"number"}}}}]}'::TEXT, "status", '{"table":"tjson","column":"status"}' )),
744
+ "jsonOneOf" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"command":{"enum":["a"]}},{"command":{"enum":["b"]},"option":{"type":"integer[]"}}]}'::TEXT, "jsonOneOf", '{"table":"tjson","column":"jsonOneOf"}' )),
745
+ "table_config" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"referencedTables":{"optional":true,"arrayOfType":{"name":"string","minFiles":"number"}},"recType":{"nullable":true,"optional":true,"record":{"keysEnum":["a","b"],"values":{"type":{"bools":"boolean[]"}}}}}}'::TEXT, "table_config", '{"table":"tjson","column":"table_config"}' ))
746
+ );
747
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
748
+
749
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col1) REFERENCES lookup_col1(id);
750
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col2) REFERENCES lookup_col1(id);
751
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col3) REFERENCES lookup_col1(id);
752
+ DROP TABLE IF EXISTS "api_table";
753
+ CREATE TABLE "api_table" (
754
+ "id" SERIAL PRIMARY KEY
755
+ );
756
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
757
+ (server): prostgles onReady
758
+ (server): Waiting for client...
759
+ (client) t+ 0ms Started client...
760
+ onSocketConnect I43L13dlZpeaR9T-AAAA
761
+ (server): Client connected -> console does not work. use log function. socket.id: I43L13dlZpeaR9T-AAAA
762
+ (client) t+ 39ms Client connect.
763
+ (client) t+ 175ms TEST_NAME: syncTriggerCleanup Started
764
+ Created PubSubManager
765
+ Pushing 0 rows to socket
766
+ ✔ subscription receives an update immediately after another trigger is deleted (405.279113ms)
767
+ Pushing 1 rows to socket x2
768
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
769
+ Client log (client) t+ 3232ms TEST_NAME: syncTriggerCleanup Finished OK
770
+ ✔ unsubscribe cleanup preserves a sync being registered (2648.386947ms)
771
+ Client test successful
772
+ (server): Stopping server ...
773
+ ℹ tests 2
774
+ ℹ suites 0
775
+ ℹ pass 2
776
+ ℹ fail 0
777
+ ℹ cancelled 0
778
+ ℹ skipped 0
779
+ ℹ todo 0
780
+ ℹ duration_ms 11452.226865
781
+
782
+ > server_tests@1.0.0 test-client
783
+ > TEST_TYPE=client node --trace-uncaught --test dist/server/index.js
784
+
785
+ Prostgles: SQL file executed successfuly /home/s/prostgles-server-js/tests/server/init.sql
786
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
787
+
788
+ DROP TABLE IF EXISTS "lookup_col1" CASCADE;
789
+ CREATE TABLE IF NOT EXISTS "lookup_col1" (
790
+ id TEXT PRIMARY KEY
791
+ , "description" TEXT
792
+ );
793
+ INSERT INTO "lookup_col1" ("id", "description") VALUES ('a','desc') ON CONFLICT DO NOTHING;
794
+ INSERT INTO "lookup_col1" ("id", "description") VALUES ('b',null) ON CONFLICT DO NOTHING;
795
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
796
+
797
+ CREATE TABLE "files" (
798
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
799
+ "storage_key" UUID UNIQUE ,
800
+ "extension" TEXT NOT NULL DEFAULT '' ,
801
+ "content_type" TEXT NOT NULL DEFAULT '' ,
802
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
803
+ "etag" TEXT NOT NULL DEFAULT '' ,
804
+ "original_name" TEXT NOT NULL ,
805
+ "original_last_modified" TIMESTAMPTZ ,
806
+ "description" TEXT ,
807
+ "url" TEXT NOT NULL DEFAULT '' ,
808
+ "cloud_url" TEXT ,
809
+ "signed_url" TEXT ,
810
+ "signed_url_expires" BIGINT ,
811
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
812
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
813
+ "deleted" TIMESTAMPTZ ,
814
+ "deleted_from_storage" TIMESTAMPTZ ,
815
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex')) ,
816
+ "version" INTEGER NOT NULL DEFAULT 1 ,
817
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files","column":"metadata"}' ))
818
+ );
819
+ CREATE TABLE "files_versions" (
820
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
821
+ "storage_key" UUID NOT NULL ,
822
+ "extension" TEXT NOT NULL DEFAULT '' ,
823
+ "content_type" TEXT NOT NULL DEFAULT '' ,
824
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
825
+ "etag" TEXT NOT NULL DEFAULT '' ,
826
+ "original_name" TEXT NOT NULL ,
827
+ "original_last_modified" TIMESTAMPTZ ,
828
+ "description" TEXT ,
829
+ "url" TEXT NOT NULL DEFAULT '' ,
830
+ "cloud_url" TEXT ,
831
+ "signed_url" TEXT ,
832
+ "signed_url_expires" BIGINT ,
833
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
834
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
835
+ "deleted" TIMESTAMPTZ ,
836
+ "deleted_from_storage" TIMESTAMPTZ ,
837
+ "file_id" UUID NOT NULL ,
838
+ "version" INTEGER NOT NULL ,
839
+ "created" TIMESTAMP NOT NULL DEFAULT NOW() ,
840
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files_versions","column":"metadata"}' ))
841
+ );
842
+ ALTER TABLE "files_versions" ADD CONSTRAINT "prostgles_file_version_e24fec525e76b3433749621f589d35d9" FOREIGN KEY (file_id) REFERENCES "files"(id) ON DELETE CASCADE;
843
+ CREATE UNIQUE INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" ON "files_versions" (file_id, version);
844
+ COMMENT ON INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" IS 'd4af15d064cae99adac0c1194199a9e3';
845
+ CREATE TABLE "users_public_info" (
846
+ "id" SERIAL PRIMARY KEY ,
847
+ "name" TEXT ,
848
+ "avatar" UUID REFERENCES files ON DELETE CASCADE ,
849
+ "sid" TEXT
850
+ );
851
+ DROP TABLE IF EXISTS "users";
852
+ CREATE TABLE "users" (
853
+ "id" SERIAL PRIMARY KEY ,
854
+ "email" TEXT NOT NULL ,
855
+ "status" TEXT NOT NULL CHECK("status" = 'active' OR "status" = 'disabled' OR "status" = 'pending'),
856
+ "type" TEXT NOT NULL ,
857
+ "preferences" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"showIntro":{"type":"boolean","optional":true},"theme":{"enum":["light","dark","auto"],"optional":true},"others":{"type":"any[]"}}}'::TEXT, "preferences", '{"table":"users","column":"preferences"}' ))
858
+ );
859
+ DROP TABLE IF EXISTS "tjson";
860
+ CREATE TABLE "tjson" (
861
+ "json" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"a":{"type":"boolean"},"arr":{"enum":["1","2","3"]},"arr1":{"enum":[1,2,3]},"arr2":{"type":"integer[]"},"arrStr":{"type":"string[]","optional":true,"nullable":true},"o":{"optional":true,"nullable":true,"oneOfType":[{"o1":"integer"},{"o2":"boolean"}]}}}'::TEXT, "json", '{"table":"tjson","column":"json"}' )),
862
+ "colOneOf" TEXT NOT NULL CHECK("colOneOf" = 'a' OR "colOneOf" = 'b' OR "colOneOf" = 'c'),
863
+ "status" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"ok":{"type":"string"}},{"err":{"type":"string"}},{"loading":{"type":{"loaded":{"type":"number"},"total":{"type":"number"}}}}]}'::TEXT, "status", '{"table":"tjson","column":"status"}' )),
864
+ "jsonOneOf" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"command":{"enum":["a"]}},{"command":{"enum":["b"]},"option":{"type":"integer[]"}}]}'::TEXT, "jsonOneOf", '{"table":"tjson","column":"jsonOneOf"}' )),
865
+ "table_config" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"referencedTables":{"optional":true,"arrayOfType":{"name":"string","minFiles":"number"}},"recType":{"nullable":true,"optional":true,"record":{"keysEnum":["a","b"],"values":{"type":{"bools":"boolean[]"}}}}}}'::TEXT, "table_config", '{"table":"tjson","column":"table_config"}' ))
866
+ );
867
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
868
+
869
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col1) REFERENCES lookup_col1(id);
870
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col2) REFERENCES lookup_col1(id);
871
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col3) REFERENCES lookup_col1(id);
872
+ DROP TABLE IF EXISTS "api_table";
873
+ CREATE TABLE "api_table" (
874
+ "id" SERIAL PRIMARY KEY
875
+ );
876
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
877
+ (server): prostgles onReady
878
+ (server): Waiting for client...
879
+ (client) t+ 0ms Started client...
880
+ onSocketConnect uPwu9EViYwDBv4yRAAAA
881
+ (server): Client connected -> console does not work. use log function. socket.id: uPwu9EViYwDBv4yRAAAA
882
+ (client) t+ 38ms Client connect.
883
+ (client) t+ 169ms TEST_NAME: main Started
884
+ Client log (client) t+ 179ms Starting isomorphic queries
885
+ ▶ Isomorphic queries
886
+ ✔ Deleting stale data (31.755993ms)
887
+ {
888
+ message: 'malformed array literal: "a"',
889
+ length: 149,
890
+ name: 'error',
891
+ severity: 'ERROR',
892
+ code: '22P02',
893
+ detail: 'Array value must start with "{" or dimension information.',
894
+ position: '325',
895
+ file: 'arrayfuncs.c',
896
+ line: '317',
897
+ routine: 'array_in',
898
+ query: '-- prostgles query id: 3dab47eb-89f6-4d0a-86f7-731a590693da\n' +
899
+ 'SET LOCAL "prostgles.user" \n' +
900
+ `TO '{"id":"1","type":"public"}';\n` +
901
+ 'SELECT \n' +
902
+ ' "prostgles_root_table_alias"."id" AS "id", \n' +
903
+ ' "prostgles_root_table_alias"."h" AS "h", \n' +
904
+ ' "prostgles_root_table_alias"."name" AS "name" \n' +
905
+ ' FROM ( \n' +
906
+ ' SELECT * \n' +
907
+ ' FROM items \n' +
908
+ ` WHERE "h" = 'a' \n` +
909
+ ' ) prostgles_root_table_alias \n' +
910
+ ' LIMIT 0',
911
+ code_info: 'invalid_text_representation'
912
+ }
913
+ {
914
+ message: 'malformed array literal: "a"',
915
+ length: 149,
916
+ name: 'error',
917
+ severity: 'ERROR',
918
+ code: '22P02',
919
+ detail: 'Array value must start with "{" or dimension information.',
920
+ position: '325',
921
+ file: 'arrayfuncs.c',
922
+ line: '317',
923
+ routine: 'array_in',
924
+ query: '-- prostgles query id: 99ed2d72-0a6d-4b4d-b32f-7b6cb6f2be0c\n' +
925
+ 'SET LOCAL "prostgles.user" \n' +
926
+ `TO '{"id":"1","type":"public"}';\n` +
927
+ 'SELECT \n' +
928
+ ' "prostgles_root_table_alias"."id" AS "id", \n' +
929
+ ' "prostgles_root_table_alias"."h" AS "h", \n' +
930
+ ' "prostgles_root_table_alias"."name" AS "name" \n' +
931
+ ' FROM ( \n' +
932
+ ' SELECT * \n' +
933
+ ' FROM items \n' +
934
+ ` WHERE "h" = 'a' \n` +
935
+ ' ) prostgles_root_table_alias \n' +
936
+ ' LIMIT 0',
937
+ code_info: 'invalid_text_representation'
938
+ }
939
+ ✔ Error structure malformed array literal (23.16338ms)
940
+ ✔ Table info (0.904204ms)
941
+ ✔ Prepare data (38.702187ms)
942
+ ✔ Test bytea (4.867351ms)
943
+ ✔ abortSignal terminates a running query (5527.808419ms)
944
+ ✔ Client queries are aborted no more than after n seconds (14005.717133ms)
945
+ ✔ Subscription tracked_columns get merged correctly (0.206016ms)
946
+ Created PubSubManager
947
+ ✔ Aggregate subscription tracks FILTER and ORDER BY dependencies (954.443423ms)
948
+ ✔ CASE select and subscription dependencies (642.562484ms)
949
+ ✔ Subscription tracks non-selected ORDER BY columns (627.110903ms)
950
+ ✔ merge json (8.524061ms)
951
+ ✔ json array converted to pg array filter bug (1.404689ms)
952
+ ✔ onConflict do update (7.158789ms)
953
+ ✔ Local file upload (38.089024ms)
954
+ ✔ Local file delete (28.101952ms)
955
+ ✔ Local file update (43.638928ms)
956
+ ✔ getColumns definition (2.553574ms)
957
+ ✔ returnType (0.922413ms)
958
+ ✔ Table config triggers (9.874629ms)
959
+ ✔ $unnest_words (2.651591ms)
960
+ ✔ Group by/Distinct (4.13233ms)
961
+ ✔ sql returntype default-with-rollback (27.260153ms)
962
+ ✔ returnType: value (1.406637ms)
963
+ ✔ PostgreSQL array element (7.05778ms)
964
+ ✔ FTS filtering (7.809451ms)
965
+ ✔ $term_highlight (4.697445ms)
966
+ ✔ funcFilters: $term_highlight (2.986707ms)
967
+ Client log (client) t+ 22260ms [{"name":null}]
968
+ Client log (client) t+ 22274ms [{"name":"zz3zz1"}]
969
+ Pushing 1 rows to socket x9
970
+ Client log (client) t+ 22893ms []
971
+ ✔ subscribe skipChangedColumnsCheck false by default = sub should not fire if selected data did not change (850.744496ms)
972
+ Pushing 0 rows to socket
973
+ Client log (client) t+ 25609ms [{"name":null}]
974
+ Client log (client) t+ 25620ms [{"name":"zz3zz1"}]
975
+ Client log (client) t+ 25835ms [{"name":"zz3zz1"}]
976
+ Client log (client) t+ 26047ms [{"name":"zz3zz1"}]
977
+ Pushing 1 rows to socket x4
978
+ Client log (client) t+ 26261ms []
979
+ ✔ subscribe skipChangedColumnsCheck true (3367.165296ms)
980
+ Pushing 0 rows to socket
981
+ Pushing 1 rows to socket x4
982
+ Client log unsubscribe start - various
983
+ Client log unsubscribe end - various
984
+ ✔ subscribe (34.813982ms)
985
+ Pushing 0 rows to socket
986
+ Pushing 1 rows to socket
987
+ ✔ subscribe to schema.table (10.671775ms)
988
+ Pushing 2 rows to socket
989
+ ✔ parallel subscriptions (2006.733203ms)
990
+ Client log (client) t+ 32605ms updateAll done in 1588
991
+ Client log (client) t+ 34190ms updateAll done in 1583
992
+ Pushing 0 rows to socket
993
+ Pushing 3 rows to socket
994
+ Client log (client) t+ 34736ms Locks: [{"pid":535231,"blocking_pids":[535435],"wait_event":"object","wait_event_type":"Lock","query":"commit","blocking_query":"commit"}]
995
+ Client log (client) t+ 34737ms Locks: [{"pid":535435,"blocking_pids":[535230],"wait_event":"object","wait_event_type":"Lock","query":"commit","blocking_query":"commit"}]
996
+ Client log (client) t+ 34737ms Locks: [{"pid":535231,"blocking_pids":[535230,535435],"wait_event":"ClientRead","wait_event_type":"Client","query":" \n -- prostgles query id: 3c9d44fb-fa43-4f54-8425-7563ac13ed5d\nSET LOCAL \"prostgles.user\" \nTO '{\"id\":\"1\",\"type\":\"public\"}'; \n INSERT INTO various (\"id\",\"name\") VALUES (1999::int4,'slowtx1999'::text) \n RETURNING *,FALSE as prostgles_check_condition\n ","blocking_query":"commit"},{"pid":535435,"blocking_pids":[535230],"wait_event":"object","wait_event_type":"Lock","query":"commit","blocking_query":"commit"}]
997
+ Client log (client) t+ 34738ms Locks: [{"pid":535231,"blocking_pids":[535435],"wait_event":"object","wait_event_type":"Lock","query":"commit","blocking_query":"commit"}]
998
+ Pushing 996 rows to socket
999
+ Client log (client) t+ 36124ms updateAll done in 1927
1000
+ Pushing 1000 rows to socket x2
1001
+ ✔ subscriptions do not serialize transactions (9617.394046ms)
1002
+ Pushing 3 rows to socket
1003
+ Pushing 1 rows to socket
1004
+ throttling sub for 1700 ms
1005
+ throttling finished. pushSubData...
1006
+ Pushing 1 rows to socket
1007
+ throttling sub for 1700 ms
1008
+ ✔ subscribeOne with throttle (1721.791307ms)
1009
+ throttling sub for 1700 ms
1010
+ throttling finished. pushSubData...
1011
+ ✔ subscribeOne with throttle skipFirst: true (1702.271607ms)
1012
+ Pushing 1 rows to socket
1013
+ throttling finished. pushSubData...
1014
+ Pushing 1 rows to socket
1015
+ ✔ subscribeOne without skipFirst (1029.809632ms)
1016
+ Pushing 0 rows to socket
1017
+ Pushing 1 rows to socket
1018
+ ✔ subscribeOne with skipFirst: true (1527.072964ms)
1019
+ Pushing 0 rows to socket x2
1020
+ ✔ subscribeOne actions: { insert: true } (1528.857021ms)
1021
+ Pushing 1 rows to socket
1022
+ ✔ subscribeOne actions: { insert: false } (1523.804757ms)
1023
+ ✔ JSON filtering (3.234401ms)
1024
+ ✔ Complex filtering (3.052414ms)
1025
+ ✔ template_string function (3.306049ms)
1026
+ ✔ Between filtering (2.380682ms)
1027
+ ✔ In filtering (2.253269ms)
1028
+ ✔ Order by (2.818105ms)
1029
+ ✔ Order by aliased func (1.983798ms)
1030
+ ✔ Filter by aliased func (1.608304ms)
1031
+ ✔ Count with Filter by aliased func (2.283512ms)
1032
+ ✔ Count with Aggregate and Filter by aliased func (2.195518ms)
1033
+ ✔ Count with complex filter (2.154381ms)
1034
+ ✔ Order by aggregation (1.705889ms)
1035
+ ✔ Aggregate FILTER and ORDER BY (1.907751ms)
1036
+ ✔ Column alias func (1.486952ms)
1037
+ ✔ Order by colliding alias name (1.700476ms)
1038
+ ✔ Update batch example (5.221366ms)
1039
+ Client log TODO: socket.io stringifies dates
1040
+ ✔ Function example (15.027702ms)
1041
+ ✔ JSONB filtering (8.821516ms)
1042
+ ✔ Postgis examples (9.627729ms)
1043
+ ✔ jsonbSchema validation (10.350796ms)
1044
+ ✔ find and findOne (2.116781ms)
1045
+ ✔ Result size (1.891409ms)
1046
+ ✔ Basic exists (2.905507ms)
1047
+ ✔ Basic fts with shorthand notation (3.087887ms)
1048
+ ✔ Exists with shortest path wildcard filter example (3.611765ms)
1049
+ ✔ Exists with exact path filter example (1.344952ms)
1050
+ ✔ Not Exists with exact path filter example (1.413389ms)
1051
+ ✔ Upsert example (14.604372ms)
1052
+ ✔ Joins example (6.041157ms)
1053
+ ✔ Joins repeating table example (4.272622ms)
1054
+ ✔ Join aggregate functions example (8.664435ms)
1055
+ ✔ $rowhash example (5.627769ms)
1056
+ ✔ Reference column nested insert (7.432454ms)
1057
+ ✔ Join escaped table names with quotes (12.603281ms)
1058
+ Pushing 0 rows to socket x2
1059
+ Client log (client) t+ 47331ms {
1060
+ "item": {
1061
+ "\"id0\"": 1,
1062
+ "\"quoted1_id\"": 1,
1063
+ "\"text_col0\"": "0"
1064
+ },
1065
+ "runs": 0
1066
+ }
1067
+ Client log (client) t+ 47336ms {
1068
+ "item": {
1069
+ "\"id0\"": 1,
1070
+ "\"quoted1_id\"": 1,
1071
+ "\"text_col0\"": "1"
1072
+ },
1073
+ "runs": 1
1074
+ }
1075
+ Client log unsubscribe start - """quoted0"""
1076
+ Client log unsubscribe end - """quoted0"""
1077
+ ✔ subscribe to escaped table name (16.469086ms)
1078
+ Pushing 1 rows to socket x2
1079
+ ✔ subscribe using a filter bigger than block_size (15.335283ms)
1080
+ ✔ Reverse join with agg (9.58556ms)
1081
+ Pushing 0 rows to socket
1082
+ Client log {"_rows":[{"id":1,"t1":null,"tr2":[{"id":1,"tr1_id":1,"t1":"a","t2":"b"}],"tr3":[]},{"id":2,"t1":null,"tr2":[{"id":2,"tr1_id":2,"t1":"a","t2":"b"}],"tr3":[]}],"runs":1}
1083
+ Client log {"_rows":[{"id":1,"t1":null,"tr2":[{"id":1,"tr1_id":1,"t1":"a","t2":"b"},{"id":3,"tr1_id":1,"t1":"a","t2":"b"}],"tr3":[]},{"id":2,"t1":null,"tr2":[{"id":2,"tr1_id":2,"t1":"a","t2":"b"}],"tr3":[]}],"runs":2}
1084
+ ✔ Related table subscribe (9027.453592ms)
1085
+ Pushing 2 rows to socket x2
1086
+ ✔ Aggregate FILTER registers joined dependency triggers (634.595407ms)
1087
+ ✔ Nested sort by computed col (6.252261ms)
1088
+ ✔ Nested function on different than source column getNewQuery name bug fix (1.434973ms)
1089
+ ✔ Reference column deep nested insert (8.924075ms)
1090
+ ✔ Multi reference column nested insert (8.108245ms)
1091
+ ✔ Join path with order by nested (6.591531ms)
1092
+ ✔ Self join (11.656935ms)
1093
+ ✔ One to many multi join duplicate row bug fix (10.729685ms)
1094
+ Client log (client) t+ 57085ms various id=99 count 1
1095
+ Pushing 1 rows to socket x3
1096
+ Client log (client) t+ 57101ms various id=99 count
1097
+ Client log ok
1098
+ Error within running subscription
1099
+ _psqlWS_..various.{"id":99}.{"select":{"name":1}}.m.sub {
1100
+ message: 'column prostgles_root_table_alias.name does not exist',
1101
+ length: 130,
1102
+ name: 'error',
1103
+ severity: 'ERROR',
1104
+ code: '42703',
1105
+ position: '133',
1106
+ file: 'parse_relation.c',
1107
+ line: '3665',
1108
+ routine: 'errorMissingColumn',
1109
+ query: '-- prostgles query id: 83fef3e2-3736-40d2-8b62-7a9fe221f791\n' +
1110
+ 'SET LOCAL "prostgles.user" \n' +
1111
+ `TO '{"id":"1","type":"public"}';\n` +
1112
+ 'SELECT \n' +
1113
+ ' "prostgles_root_table_alias"."name" AS "name" \n' +
1114
+ ' FROM ( \n' +
1115
+ ' SELECT * \n' +
1116
+ ' FROM various \n' +
1117
+ ' WHERE "id" = 99 \n' +
1118
+ ' ) prostgles_root_table_alias \n' +
1119
+ ' LIMIT 1000',
1120
+ code_info: 'undefined_column'
1121
+ }
1122
+ Client log (client) t+ 59117ms various id=99 count
1123
+ Client log (client) t+ 59117ms Error in subscription callback: {"message":"column prostgles_root_table_alias.name does not exist","length":130,"name":"error","severity":"ERROR","code":"42703","position":"133","file":"parse_relation.c","line":"3665","routine":"errorMissingColumn","query":"-- prostgles query id: 83fef3e2-3736-40d2-8b62-7a9fe221f791\nSET LOCAL \"prostgles.user\" \nTO '{\"id\":\"1\",\"type\":\"public\"}';\nSELECT \n \"prostgles_root_table_alias\".\"name\" AS \"name\" \n FROM ( \n SELECT * \n FROM various \n WHERE \"id\" = 99 \n ) prostgles_root_table_alias \n LIMIT 1000","code_info":"undefined_column"}
1124
+ Client log ok
1125
+ ✔ subscribe triggers with stale schema should fail gracefully and never block other queries (6550.611426ms)
1126
+ ✔ Isomorphic queries (63447.417581ms)
1127
+ ✔ Having clause (2.383648ms)
1128
+ ✔ Having clause with complex filter (1.715949ms)
1129
+ Client log (client) t+ 63640ms auth.user: {"sid":"main","uid":"1","id":"1","type":"public"}
1130
+ ✔ Nested join having clause (1.690038ms)
1131
+ ▶ isomorphic typed queries
1132
+ ✔ isLookupTable DB Types from colConf (0.086194ms)
1133
+ ✔ isLookupTable DB Types from reference column actual definition (0.045811ms)
1134
+ ✔ isLookupTable pkey column itself is typed (0.03536ms)
1135
+ ✔ isomorphic typed queries (0.232995ms)
1136
+ ▶ Client only queries
1137
+ ✔ modifyClientSchema adds custom table and column metadata (1.679637ms)
1138
+ ✔ SQL Stream more than 1k records (11.08461ms)
1139
+ ✔ SQL Stream persistedConnection with streamLimit works for subsequent queries (6.563094ms)
1140
+ ✔ SQL Stream ensure the connection is never released (same pg_backend_pid is the same for subsequent) when using persistConnectionId (5.674924ms)
1141
+ ✔ SQL Stream stop kills the query (1019.769891ms)
1142
+ ✔ SQL Stream limit works (20.844554ms)
1143
+ ✔ SQL Stream stop with terminate kills the query (expect flakiness) (132.336926ms)
1144
+ ✔ SQL Stream (9.740771ms)
1145
+ ✔ SQL Stream parallel execution + parameters (8.567909ms)
1146
+ ✔ SQL Stream query error structure matches default sql run error (7.89826ms)
1147
+ ✔ SQL Stream streamLimit (7.564317ms)
1148
+ ✔ SQL Stream table fields are the same as on default request (19.188094ms)
1149
+ ✔ SQL Stream works for multiple statements (9.42645ms)
1150
+ ✔ Check tableSchema (10.939418ms)
1151
+ Client log (client) t+ 64912ms Checking public data
1152
+ ✔ Security rules example (40.742061ms)
1153
+ Client log (client) t+ 64967ms Started testRealtime
1154
+ Client log (client) t+ 64990ms 1790705622897: sub stats: x10 -> 0 x20 ->0
1155
+ Client log (client) t+ 64997ms 1790705622904: sync stats: x10 -> 0 x20 -> 0
1156
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 0)
1157
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 1)
1158
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 2)
1159
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 3)
1160
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 4)
1161
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 5)
1162
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 6)
1163
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 7)
1164
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 8)
1165
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 9)
1166
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 10)
1167
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 11)
1168
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 12)
1169
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 13)
1170
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 14)
1171
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 15)
1172
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 16)
1173
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 17)
1174
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 18)
1175
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 19)
1176
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 20)
1177
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 21)
1178
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 22)
1179
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 23)
1180
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 24)
1181
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 25)
1182
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 26)
1183
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 27)
1184
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 28)
1185
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 29)
1186
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 30)
1187
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 31)
1188
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 32)
1189
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 33)
1190
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 34)
1191
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 35)
1192
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 36)
1193
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 37)
1194
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 38)
1195
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 39)
1196
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 40)
1197
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 41)
1198
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 42)
1199
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 43)
1200
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 44)
1201
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 45)
1202
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 46)
1203
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 47)
1204
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 48)
1205
+ Client log (client) t+ 64998ms 1790705622905: sync: p.$update({ x: 10 }); (id: 49)
1206
+ Pushing 0 rows to socket x4
1207
+ upsertData (from client): inserted( 0 ) updated( 50 ) total( 50 )
1208
+ last insert undefined
1209
+ last update {"id":49,"x":10,"y":49,"flight_number":"FN49","last_updated":1790705622905}
1210
+ Client log (client) t+ 65072ms 1790705622979: sub stats: x10 -> 50 x20 ->0
1211
+ Pushing 50 rows to socket
1212
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1213
+ last insert undefined
1214
+ last update undefined
1215
+ server.syncBatch planes: inserted( 0 ) updated( 50 ) deleted( 0 ) pushed to client( 50 ) total( 100 ) undefined
1216
+ Client log (client) t+ 65081ms 1790705622988: sync stats: x10 -> 50 x20 -> 0
1217
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 50)
1218
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 51)
1219
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 52)
1220
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 53)
1221
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 54)
1222
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 55)
1223
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 56)
1224
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 57)
1225
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 58)
1226
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 59)
1227
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 60)
1228
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 61)
1229
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 62)
1230
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 63)
1231
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 64)
1232
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 65)
1233
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 66)
1234
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 67)
1235
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 68)
1236
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 69)
1237
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 70)
1238
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 71)
1239
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 72)
1240
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 73)
1241
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 74)
1242
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 75)
1243
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 76)
1244
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 77)
1245
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 78)
1246
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 79)
1247
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 80)
1248
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 81)
1249
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 82)
1250
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 83)
1251
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 84)
1252
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 85)
1253
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 86)
1254
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 87)
1255
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 88)
1256
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 89)
1257
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 90)
1258
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 91)
1259
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 92)
1260
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 93)
1261
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 94)
1262
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 95)
1263
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 96)
1264
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 97)
1265
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 98)
1266
+ Client log (client) t+ 65082ms 1790705622989: sync: p.$update({ x: 10 }); (id: 99)
1267
+ Client log (client) t+ 65086ms 1790705622993: sync stats: x10 -> 100 x20 -> 0
1268
+ upsertData (from WAL): inserted( 0 ) updated( 0 ) total( 1 )
1269
+ last insert undefined
1270
+ last update undefined
1271
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1272
+ last insert undefined
1273
+ last update undefined
1274
+ upsertData (from client): inserted( 0 ) updated( 50 ) total( 50 )
1275
+ last insert undefined
1276
+ last update {"id":99,"x":10,"y":99,"flight_number":"FN99","last_updated":1790705622989}
1277
+ Client log (client) t+ 65158ms 1790705623065: sub stats: x10 -> 100 x20 ->0
1278
+ Pushing 100 rows to socket
1279
+ server.syncBatch planes: inserted( 0 ) updated( 50 ) deleted( 0 ) pushed to client( 0 ) total( 100 ) undefined
1280
+ upsertData (from WAL): inserted( 0 ) updated( 0 ) total( 50 )
1281
+ last insert undefined
1282
+ last update undefined
1283
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1284
+ last insert undefined
1285
+ last update undefined
1286
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 0 ) total( 50 ) undefined
1287
+ Client log (client) t+ 67158ms 1790705625065: sub: db.planes.update({}, { x: 20, last_updated });
1288
+ Client log (client) t+ 67166ms 1790705625070: sub: Updated to x20 100
1289
+ upsertData (from WAL): inserted( 0 ) updated( 0 ) total( 49 )
1290
+ last insert undefined
1291
+ last update undefined
1292
+ Client log (client) t+ 67179ms 1790705625086: sync stats: x10 -> 50 x20 -> 50
1293
+ Client log (client) t+ 67188ms 1790705625095: sync stats: x10 -> 0 x20 -> 100
1294
+ ✔ Realtime (2235.356886ms)
1295
+ Client log (client) t+ 67188ms 1790705625095: sync end: Finished replication test. Inserting 100 rows then updating two times took: 221ms
1296
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1297
+ last insert undefined
1298
+ last update undefined x2
1299
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 100 ) total( 100 ) undefined
1300
+ Client log (client) t+ 67190ms sync handlesOnData true 100
1301
+ ✔ sync handlesOnData true -> false no data bug (2001.453062ms)
1302
+ ﹣ Security rules example (0.106709ms) # SKIP
1303
+ ✔ Client only queries (5549.812569ms)
1304
+ ▶ React hooks
1305
+ ✔ useFind (516.604839ms)
1306
+ {
1307
+ message: 'items4.named is invalid/disallowed for filtering. Allowed columns: added, "id", "public", "name"'
1308
+ }
1309
+ ✔ useSubscribe (522.137321ms)
1310
+ ✔ useFindOne (506.837304ms)
1311
+ Pushing 1 rows to socket
1312
+ {
1313
+ message: 'items4.named is invalid/disallowed for filtering. Allowed columns: added, "id", "public", "name"'
1314
+ }
1315
+ ✔ useSubscribeOne (507.33436ms)
1316
+ ✔ useCount (506.847946ms)
1317
+ ✔ useSize (506.235492ms)
1318
+ ✔ useCount planes (252.968616ms)
1319
+ Pushing 2 rows to socket
1320
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1321
+ last insert undefined
1322
+ last update undefined
1323
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1324
+ last insert undefined
1325
+ last update undefined
1326
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1327
+ Client log (client) t+ 72790ms 1790705630697: sync stats: x10 -> 0 x20 -> 99
1328
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1329
+ last insert undefined
1330
+ last update undefined
1331
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 2 ) total( 100 ) undefined
1332
+ ✔ useSync (524.098573ms)
1333
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1334
+ last insert undefined
1335
+ last update undefined x2
1336
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1337
+ Client log (client) t+ 73059ms 1790705630966: sync stats: x10 -> 0 x20 -> 100
1338
+ Client log (client) t+ 73059ms 1790705630966: sync end: Finished replication test. Inserting 100 rows then updating two times took: 6092ms
1339
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1340
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1341
+ last insert undefined
1342
+ last update undefined x2
1343
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1344
+ Client log (client) t+ 73321ms 1790705631228: sync stats: x10 -> 0 x20 -> 99
1345
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1346
+ upsertData (from WAL): inserted( 0 ) updated( 1 ) total( 1 )
1347
+ last insert undefined
1348
+ last update {"id":0,"x":232,"last_updated":1790705631243}
1349
+ Client log (client) t+ 73355ms 1790705631262: sync stats: x10 -> 0 x20 -> 99
1350
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1351
+ last insert undefined
1352
+ last update undefined
1353
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1354
+ ✔ useSync updates invalidate useMemo without mutating old data (321.713343ms)
1355
+ Client log (client) t+ 73368ms 1790705631275: sync stats: x10 -> 0 x20 -> 99
1356
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1357
+ last insert undefined
1358
+ last update undefined x2
1359
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1360
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1361
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1362
+ last insert undefined
1363
+ last update undefined x2
1364
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1365
+ Client log (client) t+ 73643ms 1790705631550: sync stats: x10 -> 0 x20 -> 99
1366
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1367
+ upsertData (from WAL): inserted( 0 ) updated( 1 ) total( 1 )
1368
+ last insert undefined
1369
+ last update {"id":0,"x":32,"last_updated":1790705631557}
1370
+ Client log (client) t+ 73666ms 1790705631573: sync stats: x10 -> 0 x20 -> 99
1371
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1372
+ last insert undefined
1373
+ last update undefined
1374
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 1 ) undefined
1375
+ ✔ concurrent useSync hooks with matching options all update (314.286158ms)
1376
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1377
+ last insert undefined
1378
+ last update undefined
1379
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 51 ) total( 52 ) undefined
1380
+ Client log (client) t+ 73957ms Reconnected
1381
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1382
+ last insert undefined
1383
+ last update undefined
1384
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 151 ) total( 201 ) undefined
1385
+ Client log (client) t+ 73985ms 1790705631892: sync stats: x10 -> 1 x20 -> 100
1386
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999000)
1387
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999001)
1388
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999002)
1389
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999003)
1390
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999004)
1391
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999005)
1392
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999006)
1393
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999007)
1394
+ Client log (client) t+ 73985ms 1790705631892: sync: p.$update({ x: 10 }); (id: 999008)
1395
+ Client log (client) t+ 73985ms 1790705631892: sync end: Finished replication test. Inserting 100 rows then updating two times took: 7018ms
1396
+ Client log (client) t+ 73986ms TEST_NAME: main Started
1397
+ Client log (client) t+ 73989ms 1790705631896: sync stats: x10 -> 10 x20 -> 100
1398
+ Client log (client) t+ 73989ms 1790705631896: sync end: Finished replication test. Inserting 100 rows then updating two times took: 7022ms
1399
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1400
+ last insert undefined
1401
+ last update undefined
1402
+ upsertData (from WAL): inserted( 0 ) updated( 1 ) total( 1 )
1403
+ last insert undefined
1404
+ last update {"id":999000,"x":10,"last_updated":1790705631892}
1405
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 53 ) total( 54 ) undefined
1406
+ Client log (client) t+ 74012ms 1790705631919: sync stats: x10 -> 10 x20 -> 100
1407
+ Client log (client) t+ 74012ms 1790705631919: sync end: Finished replication test. Inserting 100 rows then updating two times took: 7045ms
1408
+ upsertData (from client): inserted( 0 ) updated( 8 ) total( 9 )
1409
+ last insert undefined
1410
+ last update {"id":999008,"x":10,"y":999999,"flight_number":null,"last_updated":1790705631892}
1411
+ server.syncBatch planes: inserted( 0 ) updated( 8 ) deleted( 0 ) pushed to client( 1 ) total( 10 ) undefined
1412
+ (server): Client disconnected. socket.id: uPwu9EViYwDBv4yRAAAA
1413
+ onSocketConnect a4t0j6DwDaf9E5qvAAAB
1414
+ (server): Client connected -> console does not work. use log function. socket.id: a4t0j6DwDaf9E5qvAAAB
1415
+ Client log (client) t+ 74018ms Disconnected
1416
+ Client log (client) t+ 74635ms Client connect.
1417
+ schemaChanged must syncHandler.destroySyncs()
1418
+ Client log (client) t+ 74755ms Reconnected
1419
+ Client log (client) t+ 74802ms TEST_NAME: main Started
1420
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 50 )
1421
+ last insert undefined
1422
+ last update undefined
1423
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 152 ) total( 202 ) undefined
1424
+ Client log (client) t+ 74808ms 1790705632715: sync stats: x10 -> 10 x20 -> 100
1425
+ Client log (client) t+ 74808ms 1790705632715: sync end: Finished replication test. Inserting 100 rows then updating two times took: 7841ms
1426
+ upsertData (from client): inserted( 0 ) updated( 0 ) total( 1 )
1427
+ last insert undefined
1428
+ last update undefined x2
1429
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 53 ) total( 54 ) undefined
1430
+ Client log (client) t+ 74822ms 1790705632729: sync stats: x10 -> 10 x20 -> 100
1431
+ Client log (client) t+ 74822ms 1790705632729: sync end: Finished replication test. Inserting 100 rows then updating two times took: 7855ms
1432
+ server.syncBatch planes: inserted( 0 ) updated( 0 ) deleted( 0 ) pushed to client( 1 ) total( 2 ) undefined
1433
+ ✔ concurrent useSync hooks receive inserts after reattachment and reconnect (1163.808347ms)
1434
+ ✔ React hooks (5643.401692ms)
1435
+ Client log (client) t+ 74834ms TEST_NAME: main Finished OK
1436
+ Client test successful
1437
+ (server): Stopping server ...
1438
+ ℹ tests 122
1439
+ ℹ suites 4
1440
+ ℹ pass 121
1441
+ ℹ fail 0
1442
+ ℹ cancelled 0
1443
+ ℹ skipped 1
1444
+ ℹ todo 0
1445
+ ℹ duration_ms 82894.933575
1446
+
1447
+ > server_tests@1.0.0 test-client
1448
+ > TEST_TYPE=client node --trace-uncaught --test dist/server/index.js
1449
+
1450
+ Prostgles: SQL file executed successfuly /home/s/prostgles-server-js/tests/server/init.sql
1451
+ Created PubSubManager
1452
+ watchSchema: Full re-initialisation { query: 'Only shown in debug mode' }
1453
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1454
+
1455
+ DROP TABLE IF EXISTS "lookup_col1" CASCADE;
1456
+ CREATE TABLE IF NOT EXISTS "lookup_col1" (
1457
+ id TEXT PRIMARY KEY
1458
+ , "description" TEXT
1459
+ );
1460
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1461
+
1462
+ CREATE TABLE "files" (
1463
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
1464
+ "storage_key" UUID UNIQUE ,
1465
+ "extension" TEXT NOT NULL DEFAULT '' ,
1466
+ "content_type" TEXT NOT NULL DEFAULT '' ,
1467
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
1468
+ "etag" TEXT NOT NULL DEFAULT '' ,
1469
+ "original_name" TEXT NOT NULL ,
1470
+ "original_last_modified" TIMESTAMPTZ ,
1471
+ "description" TEXT ,
1472
+ "url" TEXT NOT NULL DEFAULT '' ,
1473
+ "cloud_url" TEXT ,
1474
+ "signed_url" TEXT ,
1475
+ "signed_url_expires" BIGINT ,
1476
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
1477
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
1478
+ "deleted" TIMESTAMPTZ ,
1479
+ "deleted_from_storage" TIMESTAMPTZ ,
1480
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex')) ,
1481
+ "version" INTEGER NOT NULL DEFAULT 1 ,
1482
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files","column":"metadata"}' ))
1483
+ );
1484
+ CREATE TABLE "files_versions" (
1485
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
1486
+ "storage_key" UUID NOT NULL ,
1487
+ "extension" TEXT NOT NULL DEFAULT '' ,
1488
+ "content_type" TEXT NOT NULL DEFAULT '' ,
1489
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
1490
+ "etag" TEXT NOT NULL DEFAULT '' ,
1491
+ "original_name" TEXT NOT NULL ,
1492
+ "original_last_modified" TIMESTAMPTZ ,
1493
+ "description" TEXT ,
1494
+ "url" TEXT NOT NULL DEFAULT '' ,
1495
+ "cloud_url" TEXT ,
1496
+ "signed_url" TEXT ,
1497
+ "signed_url_expires" BIGINT ,
1498
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
1499
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
1500
+ "deleted" TIMESTAMPTZ ,
1501
+ "deleted_from_storage" TIMESTAMPTZ ,
1502
+ "file_id" UUID NOT NULL ,
1503
+ "version" INTEGER NOT NULL ,
1504
+ "created" TIMESTAMP NOT NULL DEFAULT NOW() ,
1505
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files_versions","column":"metadata"}' ))
1506
+ );
1507
+ ALTER TABLE "files_versions" ADD CONSTRAINT "prostgles_file_version_e24fec525e76b3433749621f589d35d9" FOREIGN KEY (file_id) REFERENCES "files"(id) ON DELETE CASCADE;
1508
+ CREATE UNIQUE INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" ON "files_versions" (file_id, version);
1509
+ COMMENT ON INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" IS 'd4af15d064cae99adac0c1194199a9e3';
1510
+ CREATE TABLE "users_public_info" (
1511
+ "id" SERIAL PRIMARY KEY ,
1512
+ "name" TEXT ,
1513
+ "avatar" UUID REFERENCES files ON DELETE CASCADE ,
1514
+ "sid" TEXT
1515
+ );
1516
+ DROP TABLE IF EXISTS "users";
1517
+ CREATE TABLE "users" (
1518
+ "id" SERIAL PRIMARY KEY ,
1519
+ "email" TEXT NOT NULL ,
1520
+ "status" TEXT NOT NULL CHECK("status" = 'active' OR "status" = 'disabled' OR "status" = 'pending'),
1521
+ "type" TEXT NOT NULL ,
1522
+ "preferences" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"showIntro":{"type":"boolean","optional":true},"theme":{"enum":["light","dark","auto"],"optional":true},"others":{"type":"any[]"}}}'::TEXT, "preferences", '{"table":"users","column":"preferences"}' ))
1523
+ );
1524
+ DROP TABLE IF EXISTS "tjson";
1525
+ CREATE TABLE "tjson" (
1526
+ "json" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"a":{"type":"boolean"},"arr":{"enum":["1","2","3"]},"arr1":{"enum":[1,2,3]},"arr2":{"type":"integer[]"},"arrStr":{"type":"string[]","optional":true,"nullable":true},"o":{"optional":true,"nullable":true,"oneOfType":[{"o1":"integer"},{"o2":"boolean"}]}}}'::TEXT, "json", '{"table":"tjson","column":"json"}' )),
1527
+ "colOneOf" TEXT NOT NULL CHECK("colOneOf" = 'a' OR "colOneOf" = 'b' OR "colOneOf" = 'c'),
1528
+ "status" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"ok":{"type":"string"}},{"err":{"type":"string"}},{"loading":{"type":{"loaded":{"type":"number"},"total":{"type":"number"}}}}]}'::TEXT, "status", '{"table":"tjson","column":"status"}' )),
1529
+ "jsonOneOf" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"command":{"enum":["a"]}},{"command":{"enum":["b"]},"option":{"type":"integer[]"}}]}'::TEXT, "jsonOneOf", '{"table":"tjson","column":"jsonOneOf"}' )),
1530
+ "table_config" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"referencedTables":{"optional":true,"arrayOfType":{"name":"string","minFiles":"number"}},"recType":{"nullable":true,"optional":true,"record":{"keysEnum":["a","b"],"values":{"type":{"bools":"boolean[]"}}}}}}'::TEXT, "table_config", '{"table":"tjson","column":"table_config"}' ))
1531
+ );
1532
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1533
+
1534
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col1) REFERENCES lookup_col1(id);
1535
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col2) REFERENCES lookup_col1(id);
1536
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col3) REFERENCES lookup_col1(id);
1537
+ DROP TABLE IF EXISTS "api_table";
1538
+ CREATE TABLE "api_table" (
1539
+ "id" SERIAL PRIMARY KEY
1540
+ );
1541
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
1542
+ watchSchema: Full re-initialisation { query: 'Only shown in debug mode' }
1543
+ (server): prostgles onReady
1544
+ (server): Waiting for client...
1545
+ (client) t+ 1ms Started client...
1546
+ onSocketConnect _ywFw6PqXTKGko-DAAAA
1547
+ (server): Client connected -> console does not work. use log function. socket.id: _ywFw6PqXTKGko-DAAAA
1548
+ (client) t+ 40ms Client connect.
1549
+ (client) t+ 170ms TEST_NAME: useProstgles Started
1550
+ onSocketConnect WkIObYNb38Z8optfAAAB
1551
+ (server): Client connected -> console does not work. use log function. socket.id: WkIObYNb38Z8optfAAAB
1552
+ ▶ useProstgles hook
1553
+ ✔ useProstglesClient (495.149758ms)
1554
+ watchSchema: Full re-initialisation { query: 'Only shown in debug mode' }
1555
+ (server): Client disconnected. socket.id: WkIObYNb38Z8optfAAAB
1556
+ schemaChanged must syncHandler.destroySyncs()
1557
+ ✔ useProstglesClient with schema reload (2374.803522ms)
1558
+ onSocketConnect f-G-UO4bSK0Xm3XNAAAD
1559
+ (server): Client connected -> console does not work. use log function. socket.id: f-G-UO4bSK0Xm3XNAAAD
1560
+ (server): Client disconnected. socket.id: f-G-UO4bSK0Xm3XNAAAD
1561
+ ✔ useProstglesClient with initial skip (758.487648ms)
1562
+ Client log (client) t+ 6817ms TEST_NAME: useProstgles Finished OK
1563
+ ✔ useProstgles hook (3629.270655ms)
1564
+ Client test successful
1565
+ (server): Stopping server ...
1566
+ ℹ tests 3
1567
+ ℹ suites 1
1568
+ ℹ pass 3
1569
+ ℹ fail 0
1570
+ ℹ cancelled 0
1571
+ ℹ skipped 0
1572
+ ℹ todo 0
1573
+ ℹ duration_ms 15673.747344
1574
+
1575
+ > server_tests@1.0.0 test-client
1576
+ > TEST_TYPE=client node --trace-uncaught --test dist/server/index.js
1577
+
1578
+ Prostgles: SQL file executed successfuly /home/s/prostgles-server-js/tests/server/init.sql
1579
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1580
+
1581
+ DROP TABLE IF EXISTS "lookup_col1" CASCADE;
1582
+ CREATE TABLE IF NOT EXISTS "lookup_col1" (
1583
+ id TEXT PRIMARY KEY
1584
+ , "description" TEXT
1585
+ );
1586
+ INSERT INTO "lookup_col1" ("id", "description") VALUES ('a','desc') ON CONFLICT DO NOTHING;
1587
+ INSERT INTO "lookup_col1" ("id", "description") VALUES ('b',null) ON CONFLICT DO NOTHING;
1588
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1589
+
1590
+ CREATE TABLE "files" (
1591
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
1592
+ "storage_key" UUID UNIQUE ,
1593
+ "extension" TEXT NOT NULL DEFAULT '' ,
1594
+ "content_type" TEXT NOT NULL DEFAULT '' ,
1595
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
1596
+ "etag" TEXT NOT NULL DEFAULT '' ,
1597
+ "original_name" TEXT NOT NULL ,
1598
+ "original_last_modified" TIMESTAMPTZ ,
1599
+ "description" TEXT ,
1600
+ "url" TEXT NOT NULL DEFAULT '' ,
1601
+ "cloud_url" TEXT ,
1602
+ "signed_url" TEXT ,
1603
+ "signed_url_expires" BIGINT ,
1604
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
1605
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
1606
+ "deleted" TIMESTAMPTZ ,
1607
+ "deleted_from_storage" TIMESTAMPTZ ,
1608
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex')) ,
1609
+ "version" INTEGER NOT NULL DEFAULT 1 ,
1610
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files","column":"metadata"}' ))
1611
+ );
1612
+ CREATE TABLE "files_versions" (
1613
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
1614
+ "storage_key" UUID NOT NULL ,
1615
+ "extension" TEXT NOT NULL DEFAULT '' ,
1616
+ "content_type" TEXT NOT NULL DEFAULT '' ,
1617
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
1618
+ "etag" TEXT NOT NULL DEFAULT '' ,
1619
+ "original_name" TEXT NOT NULL ,
1620
+ "original_last_modified" TIMESTAMPTZ ,
1621
+ "description" TEXT ,
1622
+ "url" TEXT NOT NULL DEFAULT '' ,
1623
+ "cloud_url" TEXT ,
1624
+ "signed_url" TEXT ,
1625
+ "signed_url_expires" BIGINT ,
1626
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
1627
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
1628
+ "deleted" TIMESTAMPTZ ,
1629
+ "deleted_from_storage" TIMESTAMPTZ ,
1630
+ "file_id" UUID NOT NULL ,
1631
+ "version" INTEGER NOT NULL ,
1632
+ "created" TIMESTAMP NOT NULL DEFAULT NOW() ,
1633
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files_versions","column":"metadata"}' ))
1634
+ );
1635
+ ALTER TABLE "files_versions" ADD CONSTRAINT "prostgles_file_version_e24fec525e76b3433749621f589d35d9" FOREIGN KEY (file_id) REFERENCES "files"(id) ON DELETE CASCADE;
1636
+ CREATE UNIQUE INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" ON "files_versions" (file_id, version);
1637
+ COMMENT ON INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" IS 'd4af15d064cae99adac0c1194199a9e3';
1638
+ CREATE TABLE "users_public_info" (
1639
+ "id" SERIAL PRIMARY KEY ,
1640
+ "name" TEXT ,
1641
+ "avatar" UUID REFERENCES files ON DELETE CASCADE ,
1642
+ "sid" TEXT
1643
+ );
1644
+ DROP TABLE IF EXISTS "users";
1645
+ CREATE TABLE "users" (
1646
+ "id" SERIAL PRIMARY KEY ,
1647
+ "email" TEXT NOT NULL ,
1648
+ "status" TEXT NOT NULL CHECK("status" = 'active' OR "status" = 'disabled' OR "status" = 'pending'),
1649
+ "type" TEXT NOT NULL ,
1650
+ "preferences" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"showIntro":{"type":"boolean","optional":true},"theme":{"enum":["light","dark","auto"],"optional":true},"others":{"type":"any[]"}}}'::TEXT, "preferences", '{"table":"users","column":"preferences"}' ))
1651
+ );
1652
+ DROP TABLE IF EXISTS "tjson";
1653
+ CREATE TABLE "tjson" (
1654
+ "json" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"a":{"type":"boolean"},"arr":{"enum":["1","2","3"]},"arr1":{"enum":[1,2,3]},"arr2":{"type":"integer[]"},"arrStr":{"type":"string[]","optional":true,"nullable":true},"o":{"optional":true,"nullable":true,"oneOfType":[{"o1":"integer"},{"o2":"boolean"}]}}}'::TEXT, "json", '{"table":"tjson","column":"json"}' )),
1655
+ "colOneOf" TEXT NOT NULL CHECK("colOneOf" = 'a' OR "colOneOf" = 'b' OR "colOneOf" = 'c'),
1656
+ "status" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"ok":{"type":"string"}},{"err":{"type":"string"}},{"loading":{"type":{"loaded":{"type":"number"},"total":{"type":"number"}}}}]}'::TEXT, "status", '{"table":"tjson","column":"status"}' )),
1657
+ "jsonOneOf" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"command":{"enum":["a"]}},{"command":{"enum":["b"]},"option":{"type":"integer[]"}}]}'::TEXT, "jsonOneOf", '{"table":"tjson","column":"jsonOneOf"}' )),
1658
+ "table_config" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"referencedTables":{"optional":true,"arrayOfType":{"name":"string","minFiles":"number"}},"recType":{"nullable":true,"optional":true,"record":{"keysEnum":["a","b"],"values":{"type":{"bools":"boolean[]"}}}}}}'::TEXT, "table_config", '{"table":"tjson","column":"table_config"}' ))
1659
+ );
1660
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1661
+
1662
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col1) REFERENCES lookup_col1(id);
1663
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col2) REFERENCES lookup_col1(id);
1664
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col3) REFERENCES lookup_col1(id);
1665
+ DROP TABLE IF EXISTS "api_table";
1666
+ CREATE TABLE "api_table" (
1667
+ "id" SERIAL PRIMARY KEY
1668
+ );
1669
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
1670
+ Prostgles: Created typescript schema definition file:
1671
+ DBGeneratedSchema.ts
1672
+ (server): prostgles onReady
1673
+ (server): Waiting for client...
1674
+ (client) t+ 0ms Started client...
1675
+ onSocketConnect HH70FbwyKP0j3w1xAAAA
1676
+ (server): Client connected -> console does not work. use log function. socket.id: HH70FbwyKP0j3w1xAAAA
1677
+ (client) t+ 29ms Client connect.
1678
+ (client) t+ 60ms TEST_NAME: files Started
1679
+ ▶ clientFileTests
1680
+ ✔ Files table is present (3.454306ms)
1681
+ ✔ Insert file from nested insert (24.184592ms)
1682
+ ✔ Cannot Insert file directly (5.284106ms)
1683
+ ✔ Disallowed updates cannot change stored bytes or create nested uploads (15.15577ms)
1684
+ ✔ Duplicate file IDs and failed validation preserve the original object (26.42132ms)
1685
+ ✔ Can update allowed files directly (44.76159ms)
1686
+ ✔ Can insert allowed files through a nested update (31.299251ms)
1687
+ Client log (client) t+ 241ms TEST_NAME: files Finished OK
1688
+ ✔ Can delete only allowed files directly (12.958207ms)
1689
+ ✔ clientFileTests (164.64937ms)
1690
+ Client test successful
1691
+ (server): Stopping server ...
1692
+ ℹ tests 8
1693
+ ℹ suites 1
1694
+ ℹ pass 8
1695
+ ℹ fail 0
1696
+ ℹ cancelled 0
1697
+ ℹ skipped 0
1698
+ ℹ todo 0
1699
+ ℹ duration_ms 8456.617821
1700
+
1701
+ > server_tests@1.0.0 test-client
1702
+ > TEST_TYPE=client node --trace-uncaught --test dist/server/index.js
1703
+
1704
+ Prostgles: SQL file executed successfuly /home/s/prostgles-server-js/tests/server/init.sql
1705
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1706
+
1707
+ DROP TABLE IF EXISTS "lookup_col1" CASCADE;
1708
+ CREATE TABLE IF NOT EXISTS "lookup_col1" (
1709
+ id TEXT PRIMARY KEY
1710
+ , "description" TEXT
1711
+ );
1712
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1713
+
1714
+ CREATE TABLE "files" (
1715
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
1716
+ "storage_key" UUID UNIQUE ,
1717
+ "extension" TEXT NOT NULL DEFAULT '' ,
1718
+ "content_type" TEXT NOT NULL DEFAULT '' ,
1719
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
1720
+ "etag" TEXT NOT NULL DEFAULT '' ,
1721
+ "original_name" TEXT NOT NULL ,
1722
+ "original_last_modified" TIMESTAMPTZ ,
1723
+ "description" TEXT ,
1724
+ "url" TEXT NOT NULL DEFAULT '' ,
1725
+ "cloud_url" TEXT ,
1726
+ "signed_url" TEXT ,
1727
+ "signed_url_expires" BIGINT ,
1728
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
1729
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
1730
+ "deleted" TIMESTAMPTZ ,
1731
+ "deleted_from_storage" TIMESTAMPTZ ,
1732
+ "data" BYTEA NOT NULL CHECK (data = decode('01', 'hex')) ,
1733
+ "version" INTEGER NOT NULL DEFAULT 1 ,
1734
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files","column":"metadata"}' ))
1735
+ );
1736
+ CREATE TABLE "files_versions" (
1737
+ "id" UUID PRIMARY KEY DEFAULT gen_random_uuid() ,
1738
+ "storage_key" UUID NOT NULL ,
1739
+ "extension" TEXT NOT NULL DEFAULT '' ,
1740
+ "content_type" TEXT NOT NULL DEFAULT '' ,
1741
+ "content_length" BIGINT NOT NULL DEFAULT 0 ,
1742
+ "etag" TEXT NOT NULL DEFAULT '' ,
1743
+ "original_name" TEXT NOT NULL ,
1744
+ "original_last_modified" TIMESTAMPTZ ,
1745
+ "description" TEXT ,
1746
+ "url" TEXT NOT NULL DEFAULT '' ,
1747
+ "cloud_url" TEXT ,
1748
+ "signed_url" TEXT ,
1749
+ "signed_url_expires" BIGINT ,
1750
+ "added" TIMESTAMP NOT NULL DEFAULT NOW() ,
1751
+ "updated" TIMESTAMP NOT NULL DEFAULT NOW() ,
1752
+ "deleted" TIMESTAMPTZ ,
1753
+ "deleted_from_storage" TIMESTAMPTZ ,
1754
+ "file_id" UUID NOT NULL ,
1755
+ "version" INTEGER NOT NULL ,
1756
+ "created" TIMESTAMP NOT NULL DEFAULT NOW() ,
1757
+ "metadata" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"description":{"type":"string"}}}'::TEXT, "metadata", '{"table":"files_versions","column":"metadata"}' ))
1758
+ );
1759
+ ALTER TABLE "files_versions" ADD CONSTRAINT "prostgles_file_version_e24fec525e76b3433749621f589d35d9" FOREIGN KEY (file_id) REFERENCES "files"(id) ON DELETE CASCADE;
1760
+ CREATE UNIQUE INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" ON "files_versions" (file_id, version);
1761
+ COMMENT ON INDEX "prostgles_file_version_9692aae50022f45f1098646939b287b1_key" IS 'd4af15d064cae99adac0c1194199a9e3';
1762
+ CREATE TABLE "users_public_info" (
1763
+ "id" SERIAL PRIMARY KEY ,
1764
+ "name" TEXT ,
1765
+ "avatar" UUID REFERENCES files ON DELETE CASCADE ,
1766
+ "sid" TEXT
1767
+ );
1768
+ DROP TABLE IF EXISTS "users";
1769
+ CREATE TABLE "users" (
1770
+ "id" SERIAL PRIMARY KEY ,
1771
+ "email" TEXT NOT NULL ,
1772
+ "status" TEXT NOT NULL CHECK("status" = 'active' OR "status" = 'disabled' OR "status" = 'pending'),
1773
+ "type" TEXT NOT NULL ,
1774
+ "preferences" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"showIntro":{"type":"boolean","optional":true},"theme":{"enum":["light","dark","auto"],"optional":true},"others":{"type":"any[]"}}}'::TEXT, "preferences", '{"table":"users","column":"preferences"}' ))
1775
+ );
1776
+ DROP TABLE IF EXISTS "tjson";
1777
+ CREATE TABLE "tjson" (
1778
+ "json" JSONB NOT NULL CHECK(prostgles.validate_jsonb_schema('{"type":{"a":{"type":"boolean"},"arr":{"enum":["1","2","3"]},"arr1":{"enum":[1,2,3]},"arr2":{"type":"integer[]"},"arrStr":{"type":"string[]","optional":true,"nullable":true},"o":{"optional":true,"nullable":true,"oneOfType":[{"o1":"integer"},{"o2":"boolean"}]}}}'::TEXT, "json", '{"table":"tjson","column":"json"}' )),
1779
+ "colOneOf" TEXT NOT NULL CHECK("colOneOf" = 'a' OR "colOneOf" = 'b' OR "colOneOf" = 'c'),
1780
+ "status" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"ok":{"type":"string"}},{"err":{"type":"string"}},{"loading":{"type":{"loaded":{"type":"number"},"total":{"type":"number"}}}}]}'::TEXT, "status", '{"table":"tjson","column":"status"}' )),
1781
+ "jsonOneOf" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"oneOfType":[{"command":{"enum":["a"]}},{"command":{"enum":["b"]},"option":{"type":"integer[]"}}]}'::TEXT, "jsonOneOf", '{"table":"tjson","column":"jsonOneOf"}' )),
1782
+ "table_config" JSONB CHECK(prostgles.validate_jsonb_schema('{"nullable":true,"type":{"referencedTables":{"optional":true,"arrayOfType":{"name":"string","minFiles":"number"}},"recType":{"nullable":true,"optional":true,"record":{"keysEnum":["a","b"],"values":{"type":{"bools":"boolean[]"}}}}}}'::TEXT, "table_config", '{"table":"tjson","column":"table_config"}' ))
1783
+ );
1784
+ Running queries: /* prostgles internal query that should be excluded from schema watch */
1785
+
1786
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col1) REFERENCES lookup_col1(id);
1787
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col2) REFERENCES lookup_col1(id);
1788
+ ALTER TABLE "uuid_text" ADD FOREIGN KEY (col3) REFERENCES lookup_col1(id);
1789
+ DROP TABLE IF EXISTS "api_table";
1790
+ CREATE TABLE "api_table" (
1791
+ "id" SERIAL PRIMARY KEY
1792
+ );
1793
+ Prostgles: Initiated file manager. Max allowed file size: 1MB (maxHttpBufferSize = 1e6). To increase this set maxHttpBufferSize in socket.io server init options
1794
+ (server): prostgles onReady
1795
+ (server): Waiting for client...
1796
+ (client) t+ 0ms Started client...
1797
+ onSocketConnect rzD0f5GN7knPInZlAAAA
1798
+ (server): Client connected -> console does not work. use log function. socket.id: rzD0f5GN7knPInZlAAAA
1799
+ (client) t+ 26ms Client connect.
1800
+ (client) t+ 35ms TEST_NAME: rest_api Started
1801
+ ▶ clientRestApi
1802
+ ✔ Rest api test (80.38933ms)
1803
+ ✔ Rest api security (21.162233ms)
1804
+ Client log (client) t+ 141ms TEST_NAME: rest_api Finished OK
1805
+ ✔ clientRestApi (102.289309ms)
1806
+ Client test successful
1807
+ (server): Stopping server ...
1808
+ ℹ tests 2
1809
+ ℹ suites 1
1810
+ ℹ pass 2
1811
+ ℹ fail 0
1812
+ ℹ cancelled 0
1813
+ ℹ skipped 0
1814
+ ℹ todo 0
1815
+ ℹ duration_ms 8299.384923