@morlay/session-rdb 0.0.20 → 0.0.21-alpha.0

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 (69) hide show
  1. package/README.md +59 -31
  2. package/dist/artifact.d.mts +25 -65
  3. package/dist/artifact.mjs +2 -2
  4. package/dist/{schema-BkQN5GyT.d.mts → backend-DpdtxYpz.d.mts} +346 -93
  5. package/dist/{branch-Co6xlbi0.mjs → branch-5JzX9rUq.mjs} +163 -52
  6. package/dist/deletion.d.mts +7 -0
  7. package/dist/deletion.mjs +2 -0
  8. package/dist/dist-vIVO6bA-.mjs +1524 -0
  9. package/dist/import.d.mts +4 -4
  10. package/dist/import.mjs +28 -11
  11. package/dist/index.d.mts +2 -3
  12. package/dist/index.mjs +4 -1631
  13. package/dist/{log-DO69NQnn.mjs → log-CnYct2Dv.mjs} +37 -82
  14. package/dist/{sqlite-DYExtbLo.mjs → sqlite-fpvm5Dzs.mjs} +205 -75
  15. package/dist/src-CWTWV7vx.mjs +1904 -0
  16. package/dist/storage.d.mts +14 -5
  17. package/dist/storage.mjs +2 -2
  18. package/dist/testing.d.mts +1 -26
  19. package/dist/testing.mjs +10503 -9614
  20. package/drizzle/postgres/20260918120000_v3_event_usage/migration.sql +14 -0
  21. package/drizzle/postgres/20260918120000_v3_event_usage/snapshot.json +1309 -0
  22. package/drizzle/sqlite/20260918120000_v3_event_usage/migration.sql +14 -0
  23. package/drizzle/sqlite/20260918120000_v3_event_usage/snapshot.json +1031 -0
  24. package/package.json +28 -29
  25. package/src/adapters/to-postgres.ts +1 -3
  26. package/src/adapters/to-sqlite.ts +0 -2
  27. package/src/adapters/types.ts +0 -3
  28. package/src/artifact.ts +0 -2
  29. package/src/backend.ts +31 -2
  30. package/src/branch.ts +223 -135
  31. package/src/deletion.ts +87 -0
  32. package/src/drizzle/postgres-v2.ts +0 -1
  33. package/src/drizzle/postgres-v3.ts +0 -1
  34. package/src/drizzle/sqlite-v2.ts +0 -1
  35. package/src/drizzle/sqlite-v3.ts +0 -1
  36. package/src/entities/v2/session-events.ts +0 -1
  37. package/src/entities/v3/event-usage.ts +25 -0
  38. package/src/entities/v3/events.ts +1 -3
  39. package/src/entities/v3/index.ts +4 -0
  40. package/src/entities/v3/session-events.ts +1 -2
  41. package/src/entities/v3/session-projcache-rows.ts +0 -8
  42. package/src/entities/v3/sessions.ts +3 -3
  43. package/src/entities/v3/storage-units.ts +0 -1
  44. package/src/entities/v3/workspace-sessions.ts +0 -5
  45. package/src/entities/v3/workspace-state.ts +0 -6
  46. package/src/entities/v3/workspaces.ts +0 -5
  47. package/src/export.ts +103 -0
  48. package/src/gc.ts +76 -0
  49. package/src/import-storages.ts +4 -37
  50. package/src/import.ts +54 -31
  51. package/src/index.ts +150 -114
  52. package/src/legacy.ts +4 -42
  53. package/src/log.ts +63 -106
  54. package/src/postgres.ts +249 -22
  55. package/src/schema.ts +6 -6
  56. package/src/session-query.ts +0 -4
  57. package/src/sqlite.ts +231 -55
  58. package/src/storage-takeover/index.ts +2 -28
  59. package/src/storage-takeover/projection-cache.ts +30 -134
  60. package/src/storage-takeover/repository.ts +20 -59
  61. package/src/storage-takeover/storage-backend.ts +3 -33
  62. package/src/storage-takeover/types.ts +14 -56
  63. package/src/storage.ts +0 -2
  64. package/src/testing/contract.ts +19 -50
  65. package/src/testing/coordinator-contract.ts +10 -25
  66. package/src/testing.ts +1 -4
  67. package/src/usage.ts +191 -0
  68. package/dist/index-D55G9n4k.d.mts +0 -271
  69. package/dist/magic-string.es-BgJoa-3K.mjs +0 -1017
@@ -0,0 +1,1309 @@
1
+ {
2
+ "version": "8",
3
+ "dialect": "postgres",
4
+ "id": "c7ea49df-e1ea-4d7e-b5de-410bd5d48500",
5
+ "prevIds": ["e3124e65-ea58-4b08-b8aa-2db3e00d1726"],
6
+ "ddl": [
7
+ {
8
+ "isRlsEnabled": false,
9
+ "name": "t_events",
10
+ "entityType": "tables",
11
+ "schema": "public"
12
+ },
13
+ {
14
+ "isRlsEnabled": false,
15
+ "name": "t_persistence_state",
16
+ "entityType": "tables",
17
+ "schema": "public"
18
+ },
19
+ {
20
+ "isRlsEnabled": false,
21
+ "name": "t_schema_meta",
22
+ "entityType": "tables",
23
+ "schema": "public"
24
+ },
25
+ {
26
+ "isRlsEnabled": false,
27
+ "name": "t_session_events",
28
+ "entityType": "tables",
29
+ "schema": "public"
30
+ },
31
+ {
32
+ "isRlsEnabled": false,
33
+ "name": "t_sessions",
34
+ "entityType": "tables",
35
+ "schema": "public"
36
+ },
37
+ {
38
+ "type": "serial",
39
+ "typeSchema": null,
40
+ "notNull": true,
41
+ "dimensions": 0,
42
+ "default": null,
43
+ "generated": null,
44
+ "identity": null,
45
+ "name": "f_id",
46
+ "entityType": "columns",
47
+ "schema": "public",
48
+ "table": "t_events"
49
+ },
50
+ {
51
+ "type": "text",
52
+ "typeSchema": null,
53
+ "notNull": true,
54
+ "dimensions": 0,
55
+ "default": null,
56
+ "generated": null,
57
+ "identity": null,
58
+ "name": "f_event_id",
59
+ "entityType": "columns",
60
+ "schema": "public",
61
+ "table": "t_events"
62
+ },
63
+ {
64
+ "type": "text",
65
+ "typeSchema": null,
66
+ "notNull": true,
67
+ "dimensions": 0,
68
+ "default": "''",
69
+ "generated": null,
70
+ "identity": null,
71
+ "name": "f_parent_id",
72
+ "entityType": "columns",
73
+ "schema": "public",
74
+ "table": "t_events"
75
+ },
76
+ {
77
+ "type": "text",
78
+ "typeSchema": null,
79
+ "notNull": true,
80
+ "dimensions": 0,
81
+ "default": "''",
82
+ "generated": null,
83
+ "identity": null,
84
+ "name": "f_type",
85
+ "entityType": "columns",
86
+ "schema": "public",
87
+ "table": "t_events"
88
+ },
89
+ {
90
+ "type": "text",
91
+ "typeSchema": null,
92
+ "notNull": true,
93
+ "dimensions": 0,
94
+ "default": "''",
95
+ "generated": null,
96
+ "identity": null,
97
+ "name": "f_kind",
98
+ "entityType": "columns",
99
+ "schema": "public",
100
+ "table": "t_events"
101
+ },
102
+ {
103
+ "type": "text",
104
+ "typeSchema": null,
105
+ "notNull": true,
106
+ "dimensions": 0,
107
+ "default": "''",
108
+ "generated": null,
109
+ "identity": null,
110
+ "name": "f_role",
111
+ "entityType": "columns",
112
+ "schema": "public",
113
+ "table": "t_events"
114
+ },
115
+ {
116
+ "type": "text",
117
+ "typeSchema": null,
118
+ "notNull": true,
119
+ "dimensions": 0,
120
+ "default": "''",
121
+ "generated": null,
122
+ "identity": null,
123
+ "name": "f_name",
124
+ "entityType": "columns",
125
+ "schema": "public",
126
+ "table": "t_events"
127
+ },
128
+ {
129
+ "type": "text",
130
+ "typeSchema": null,
131
+ "notNull": true,
132
+ "dimensions": 0,
133
+ "default": "''",
134
+ "generated": null,
135
+ "identity": null,
136
+ "name": "f_action_id",
137
+ "entityType": "columns",
138
+ "schema": "public",
139
+ "table": "t_events"
140
+ },
141
+ {
142
+ "type": "text",
143
+ "typeSchema": null,
144
+ "notNull": true,
145
+ "dimensions": 0,
146
+ "default": "''",
147
+ "generated": null,
148
+ "identity": null,
149
+ "name": "f_encoding",
150
+ "entityType": "columns",
151
+ "schema": "public",
152
+ "table": "t_events"
153
+ },
154
+ {
155
+ "type": "text",
156
+ "typeSchema": null,
157
+ "notNull": true,
158
+ "dimensions": 0,
159
+ "default": null,
160
+ "generated": null,
161
+ "identity": null,
162
+ "name": "f_data",
163
+ "entityType": "columns",
164
+ "schema": "public",
165
+ "table": "t_events"
166
+ },
167
+ {
168
+ "type": "bigint",
169
+ "typeSchema": null,
170
+ "notNull": true,
171
+ "dimensions": 0,
172
+ "default": "0",
173
+ "generated": null,
174
+ "identity": null,
175
+ "name": "f_created_at",
176
+ "entityType": "columns",
177
+ "schema": "public",
178
+ "table": "t_events"
179
+ },
180
+ {
181
+ "type": "integer",
182
+ "typeSchema": null,
183
+ "notNull": true,
184
+ "dimensions": 0,
185
+ "default": null,
186
+ "generated": null,
187
+ "identity": null,
188
+ "name": "f_singleton",
189
+ "entityType": "columns",
190
+ "schema": "public",
191
+ "table": "t_persistence_state"
192
+ },
193
+ {
194
+ "type": "text",
195
+ "typeSchema": null,
196
+ "notNull": true,
197
+ "dimensions": 0,
198
+ "default": null,
199
+ "generated": null,
200
+ "identity": null,
201
+ "name": "f_store_id",
202
+ "entityType": "columns",
203
+ "schema": "public",
204
+ "table": "t_persistence_state"
205
+ },
206
+ {
207
+ "type": "text",
208
+ "typeSchema": null,
209
+ "notNull": true,
210
+ "dimensions": 0,
211
+ "default": null,
212
+ "generated": null,
213
+ "identity": null,
214
+ "name": "f_key",
215
+ "entityType": "columns",
216
+ "schema": "public",
217
+ "table": "t_schema_meta"
218
+ },
219
+ {
220
+ "type": "text",
221
+ "typeSchema": null,
222
+ "notNull": true,
223
+ "dimensions": 0,
224
+ "default": null,
225
+ "generated": null,
226
+ "identity": null,
227
+ "name": "f_value",
228
+ "entityType": "columns",
229
+ "schema": "public",
230
+ "table": "t_schema_meta"
231
+ },
232
+ {
233
+ "type": "serial",
234
+ "typeSchema": null,
235
+ "notNull": true,
236
+ "dimensions": 0,
237
+ "default": null,
238
+ "generated": null,
239
+ "identity": null,
240
+ "name": "f_id",
241
+ "entityType": "columns",
242
+ "schema": "public",
243
+ "table": "t_session_events"
244
+ },
245
+ {
246
+ "type": "text",
247
+ "typeSchema": null,
248
+ "notNull": true,
249
+ "dimensions": 0,
250
+ "default": null,
251
+ "generated": null,
252
+ "identity": null,
253
+ "name": "f_session_id",
254
+ "entityType": "columns",
255
+ "schema": "public",
256
+ "table": "t_session_events"
257
+ },
258
+ {
259
+ "type": "text",
260
+ "typeSchema": null,
261
+ "notNull": true,
262
+ "dimensions": 0,
263
+ "default": null,
264
+ "generated": null,
265
+ "identity": null,
266
+ "name": "f_event_id",
267
+ "entityType": "columns",
268
+ "schema": "public",
269
+ "table": "t_session_events"
270
+ },
271
+ {
272
+ "type": "integer",
273
+ "typeSchema": null,
274
+ "notNull": true,
275
+ "dimensions": 0,
276
+ "default": null,
277
+ "generated": null,
278
+ "identity": null,
279
+ "name": "f_sequence",
280
+ "entityType": "columns",
281
+ "schema": "public",
282
+ "table": "t_session_events"
283
+ },
284
+ {
285
+ "type": "text",
286
+ "typeSchema": null,
287
+ "notNull": false,
288
+ "dimensions": 0,
289
+ "default": null,
290
+ "generated": null,
291
+ "identity": null,
292
+ "name": "f_surface_op",
293
+ "entityType": "columns",
294
+ "schema": "public",
295
+ "table": "t_session_events"
296
+ },
297
+ {
298
+ "type": "serial",
299
+ "typeSchema": null,
300
+ "notNull": true,
301
+ "dimensions": 0,
302
+ "default": null,
303
+ "generated": null,
304
+ "identity": null,
305
+ "name": "f_id",
306
+ "entityType": "columns",
307
+ "schema": "public",
308
+ "table": "t_sessions"
309
+ },
310
+ {
311
+ "type": "text",
312
+ "typeSchema": null,
313
+ "notNull": true,
314
+ "dimensions": 0,
315
+ "default": null,
316
+ "generated": null,
317
+ "identity": null,
318
+ "name": "f_session_id",
319
+ "entityType": "columns",
320
+ "schema": "public",
321
+ "table": "t_sessions"
322
+ },
323
+ {
324
+ "type": "text",
325
+ "typeSchema": null,
326
+ "notNull": true,
327
+ "dimensions": 0,
328
+ "default": "''",
329
+ "generated": null,
330
+ "identity": null,
331
+ "name": "f_head_event_id",
332
+ "entityType": "columns",
333
+ "schema": "public",
334
+ "table": "t_sessions"
335
+ },
336
+ {
337
+ "type": "integer",
338
+ "typeSchema": null,
339
+ "notNull": true,
340
+ "dimensions": 0,
341
+ "default": "-1",
342
+ "generated": null,
343
+ "identity": null,
344
+ "name": "f_head_sequence",
345
+ "entityType": "columns",
346
+ "schema": "public",
347
+ "table": "t_sessions"
348
+ },
349
+ {
350
+ "type": "integer",
351
+ "typeSchema": null,
352
+ "notNull": true,
353
+ "dimensions": 0,
354
+ "default": null,
355
+ "generated": null,
356
+ "identity": null,
357
+ "name": "f_version",
358
+ "entityType": "columns",
359
+ "schema": "public",
360
+ "table": "t_sessions"
361
+ },
362
+ {
363
+ "type": "bigint",
364
+ "typeSchema": null,
365
+ "notNull": true,
366
+ "dimensions": 0,
367
+ "default": null,
368
+ "generated": null,
369
+ "identity": null,
370
+ "name": "f_created_at",
371
+ "entityType": "columns",
372
+ "schema": "public",
373
+ "table": "t_sessions"
374
+ },
375
+ {
376
+ "type": "text",
377
+ "typeSchema": null,
378
+ "notNull": false,
379
+ "dimensions": 0,
380
+ "default": null,
381
+ "generated": null,
382
+ "identity": null,
383
+ "name": "f_cwd",
384
+ "entityType": "columns",
385
+ "schema": "public",
386
+ "table": "t_sessions"
387
+ },
388
+ {
389
+ "type": "text",
390
+ "typeSchema": null,
391
+ "notNull": false,
392
+ "dimensions": 0,
393
+ "default": null,
394
+ "generated": null,
395
+ "identity": null,
396
+ "name": "f_parent_session",
397
+ "entityType": "columns",
398
+ "schema": "public",
399
+ "table": "t_sessions"
400
+ },
401
+ {
402
+ "type": "integer",
403
+ "typeSchema": null,
404
+ "notNull": false,
405
+ "dimensions": 0,
406
+ "default": null,
407
+ "generated": null,
408
+ "identity": null,
409
+ "name": "f_seed_length",
410
+ "entityType": "columns",
411
+ "schema": "public",
412
+ "table": "t_sessions"
413
+ },
414
+ {
415
+ "type": "text",
416
+ "typeSchema": null,
417
+ "notNull": false,
418
+ "dimensions": 0,
419
+ "default": null,
420
+ "generated": null,
421
+ "identity": null,
422
+ "name": "f_origin",
423
+ "entityType": "columns",
424
+ "schema": "public",
425
+ "table": "t_sessions"
426
+ },
427
+ {
428
+ "type": "integer",
429
+ "typeSchema": null,
430
+ "notNull": false,
431
+ "dimensions": 0,
432
+ "default": null,
433
+ "generated": null,
434
+ "identity": null,
435
+ "name": "f_delegation_depth",
436
+ "entityType": "columns",
437
+ "schema": "public",
438
+ "table": "t_sessions"
439
+ },
440
+ {
441
+ "type": "text",
442
+ "typeSchema": null,
443
+ "notNull": true,
444
+ "dimensions": 0,
445
+ "default": null,
446
+ "generated": null,
447
+ "identity": null,
448
+ "name": "f_incarnation",
449
+ "entityType": "columns",
450
+ "schema": "public",
451
+ "table": "t_sessions"
452
+ },
453
+ {
454
+ "type": "integer",
455
+ "typeSchema": null,
456
+ "notNull": true,
457
+ "dimensions": 0,
458
+ "default": null,
459
+ "generated": null,
460
+ "identity": null,
461
+ "name": "f_revision",
462
+ "entityType": "columns",
463
+ "schema": "public",
464
+ "table": "t_sessions"
465
+ },
466
+ {
467
+ "nameExplicit": true,
468
+ "columns": [
469
+ {
470
+ "value": "f_kind",
471
+ "isExpression": false,
472
+ "asc": true,
473
+ "nullsFirst": false,
474
+ "opclass": null
475
+ }
476
+ ],
477
+ "isUnique": false,
478
+ "where": null,
479
+ "with": "",
480
+ "method": "btree",
481
+ "concurrently": false,
482
+ "name": "idx_events_kind",
483
+ "entityType": "indexes",
484
+ "schema": "public",
485
+ "table": "t_events"
486
+ },
487
+ {
488
+ "nameExplicit": true,
489
+ "columns": [
490
+ {
491
+ "value": "f_role",
492
+ "isExpression": false,
493
+ "asc": true,
494
+ "nullsFirst": false,
495
+ "opclass": null
496
+ }
497
+ ],
498
+ "isUnique": false,
499
+ "where": null,
500
+ "with": "",
501
+ "method": "btree",
502
+ "concurrently": false,
503
+ "name": "idx_events_role",
504
+ "entityType": "indexes",
505
+ "schema": "public",
506
+ "table": "t_events"
507
+ },
508
+ {
509
+ "nameExplicit": true,
510
+ "columns": [
511
+ {
512
+ "value": "f_name",
513
+ "isExpression": false,
514
+ "asc": true,
515
+ "nullsFirst": false,
516
+ "opclass": null
517
+ }
518
+ ],
519
+ "isUnique": false,
520
+ "where": null,
521
+ "with": "",
522
+ "method": "btree",
523
+ "concurrently": false,
524
+ "name": "idx_events_name",
525
+ "entityType": "indexes",
526
+ "schema": "public",
527
+ "table": "t_events"
528
+ },
529
+ {
530
+ "nameExplicit": true,
531
+ "columns": [
532
+ {
533
+ "value": "f_action_id",
534
+ "isExpression": false,
535
+ "asc": true,
536
+ "nullsFirst": false,
537
+ "opclass": null
538
+ }
539
+ ],
540
+ "isUnique": false,
541
+ "where": null,
542
+ "with": "",
543
+ "method": "btree",
544
+ "concurrently": false,
545
+ "name": "idx_events_action_id",
546
+ "entityType": "indexes",
547
+ "schema": "public",
548
+ "table": "t_events"
549
+ },
550
+ {
551
+ "nameExplicit": true,
552
+ "columns": [
553
+ {
554
+ "value": "f_event_id",
555
+ "isExpression": false,
556
+ "asc": true,
557
+ "nullsFirst": false,
558
+ "opclass": null
559
+ }
560
+ ],
561
+ "isUnique": false,
562
+ "where": null,
563
+ "with": "",
564
+ "method": "btree",
565
+ "concurrently": false,
566
+ "name": "idx_session_events_event_id",
567
+ "entityType": "indexes",
568
+ "schema": "public",
569
+ "table": "t_session_events"
570
+ },
571
+ {
572
+ "nameExplicit": false,
573
+ "columns": ["f_session_id"],
574
+ "schemaTo": "public",
575
+ "tableTo": "t_sessions",
576
+ "columnsTo": ["f_session_id"],
577
+ "onUpdate": "NO ACTION",
578
+ "onDelete": "CASCADE",
579
+ "name": "t_session_events_f_session_id_t_sessions_f_session_id_fkey",
580
+ "entityType": "fks",
581
+ "schema": "public",
582
+ "table": "t_session_events"
583
+ },
584
+ {
585
+ "nameExplicit": false,
586
+ "columns": ["f_event_id"],
587
+ "schemaTo": "public",
588
+ "tableTo": "t_events",
589
+ "columnsTo": ["f_event_id"],
590
+ "onUpdate": "NO ACTION",
591
+ "onDelete": "CASCADE",
592
+ "name": "t_session_events_f_event_id_t_events_f_event_id_fkey",
593
+ "entityType": "fks",
594
+ "schema": "public",
595
+ "table": "t_session_events"
596
+ },
597
+ {
598
+ "columns": ["f_id"],
599
+ "nameExplicit": false,
600
+ "name": "t_events_pkey",
601
+ "schema": "public",
602
+ "table": "t_events",
603
+ "entityType": "pks"
604
+ },
605
+ {
606
+ "columns": ["f_singleton"],
607
+ "nameExplicit": false,
608
+ "name": "t_persistence_state_pkey",
609
+ "schema": "public",
610
+ "table": "t_persistence_state",
611
+ "entityType": "pks"
612
+ },
613
+ {
614
+ "columns": ["f_key"],
615
+ "nameExplicit": false,
616
+ "name": "t_schema_meta_pkey",
617
+ "schema": "public",
618
+ "table": "t_schema_meta",
619
+ "entityType": "pks"
620
+ },
621
+ {
622
+ "columns": ["f_id"],
623
+ "nameExplicit": false,
624
+ "name": "t_session_events_pkey",
625
+ "schema": "public",
626
+ "table": "t_session_events",
627
+ "entityType": "pks"
628
+ },
629
+ {
630
+ "columns": ["f_id"],
631
+ "nameExplicit": false,
632
+ "name": "t_sessions_pkey",
633
+ "schema": "public",
634
+ "table": "t_sessions",
635
+ "entityType": "pks"
636
+ },
637
+ {
638
+ "nameExplicit": true,
639
+ "columns": ["f_session_id", "f_sequence"],
640
+ "nullsNotDistinct": false,
641
+ "name": "uq_session_events_session_sequence",
642
+ "entityType": "uniques",
643
+ "schema": "public",
644
+ "table": "t_session_events"
645
+ },
646
+ {
647
+ "nameExplicit": false,
648
+ "columns": ["f_event_id"],
649
+ "nullsNotDistinct": false,
650
+ "name": "t_events_f_event_id_key",
651
+ "schema": "public",
652
+ "table": "t_events",
653
+ "entityType": "uniques"
654
+ },
655
+ {
656
+ "nameExplicit": false,
657
+ "columns": ["f_session_id"],
658
+ "nullsNotDistinct": false,
659
+ "name": "t_sessions_f_session_id_key",
660
+ "schema": "public",
661
+ "table": "t_sessions",
662
+ "entityType": "uniques"
663
+ },
664
+ {
665
+ "value": "f_singleton = 1",
666
+ "name": "ck_persistence_state_singleton",
667
+ "entityType": "checks",
668
+ "schema": "public",
669
+ "table": "t_persistence_state"
670
+ },
671
+ {
672
+ "isRlsEnabled": false,
673
+ "name": "t_session_projcache_row",
674
+ "entityType": "tables",
675
+ "schema": "public"
676
+ },
677
+ {
678
+ "isRlsEnabled": false,
679
+ "name": "t_storage_units",
680
+ "entityType": "tables",
681
+ "schema": "public"
682
+ },
683
+ {
684
+ "isRlsEnabled": false,
685
+ "name": "t_workspace_state",
686
+ "entityType": "tables",
687
+ "schema": "public"
688
+ },
689
+ {
690
+ "isRlsEnabled": false,
691
+ "name": "t_workspaces",
692
+ "entityType": "tables",
693
+ "schema": "public"
694
+ },
695
+ {
696
+ "isRlsEnabled": false,
697
+ "name": "t_workspace_sessions",
698
+ "entityType": "tables",
699
+ "schema": "public"
700
+ },
701
+ {
702
+ "type": "bigint",
703
+ "typeSchema": null,
704
+ "notNull": false,
705
+ "dimensions": 0,
706
+ "default": null,
707
+ "generated": null,
708
+ "identity": null,
709
+ "name": "f_archived_at",
710
+ "entityType": "columns",
711
+ "schema": "public",
712
+ "table": "t_sessions"
713
+ },
714
+ {
715
+ "type": "text",
716
+ "typeSchema": null,
717
+ "notNull": false,
718
+ "dimensions": 0,
719
+ "default": null,
720
+ "generated": null,
721
+ "identity": null,
722
+ "name": "f_title",
723
+ "entityType": "columns",
724
+ "schema": "public",
725
+ "table": "t_sessions"
726
+ },
727
+ {
728
+ "type": "integer",
729
+ "typeSchema": null,
730
+ "notNull": false,
731
+ "dimensions": 0,
732
+ "default": null,
733
+ "generated": null,
734
+ "identity": null,
735
+ "name": "f_title_seq",
736
+ "entityType": "columns",
737
+ "schema": "public",
738
+ "table": "t_sessions"
739
+ },
740
+ {
741
+ "type": "serial",
742
+ "typeSchema": null,
743
+ "notNull": true,
744
+ "dimensions": 0,
745
+ "default": null,
746
+ "generated": null,
747
+ "identity": null,
748
+ "name": "f_id",
749
+ "entityType": "columns",
750
+ "schema": "public",
751
+ "table": "t_session_projcache_row"
752
+ },
753
+ {
754
+ "type": "text",
755
+ "typeSchema": null,
756
+ "notNull": true,
757
+ "dimensions": 0,
758
+ "default": null,
759
+ "generated": null,
760
+ "identity": null,
761
+ "name": "f_session_id",
762
+ "entityType": "columns",
763
+ "schema": "public",
764
+ "table": "t_session_projcache_row"
765
+ },
766
+ {
767
+ "type": "text",
768
+ "typeSchema": null,
769
+ "notNull": true,
770
+ "dimensions": 0,
771
+ "default": null,
772
+ "generated": null,
773
+ "identity": null,
774
+ "name": "f_key",
775
+ "entityType": "columns",
776
+ "schema": "public",
777
+ "table": "t_session_projcache_row"
778
+ },
779
+ {
780
+ "type": "integer",
781
+ "typeSchema": null,
782
+ "notNull": true,
783
+ "dimensions": 0,
784
+ "default": null,
785
+ "generated": null,
786
+ "identity": null,
787
+ "name": "f_ver",
788
+ "entityType": "columns",
789
+ "schema": "public",
790
+ "table": "t_session_projcache_row"
791
+ },
792
+ {
793
+ "type": "integer",
794
+ "typeSchema": null,
795
+ "notNull": true,
796
+ "dimensions": 0,
797
+ "default": null,
798
+ "generated": null,
799
+ "identity": null,
800
+ "name": "f_seq",
801
+ "entityType": "columns",
802
+ "schema": "public",
803
+ "table": "t_session_projcache_row"
804
+ },
805
+ {
806
+ "type": "text",
807
+ "typeSchema": null,
808
+ "notNull": true,
809
+ "dimensions": 0,
810
+ "default": null,
811
+ "generated": null,
812
+ "identity": null,
813
+ "name": "f_val",
814
+ "entityType": "columns",
815
+ "schema": "public",
816
+ "table": "t_session_projcache_row"
817
+ },
818
+ {
819
+ "type": "text",
820
+ "typeSchema": null,
821
+ "notNull": true,
822
+ "dimensions": 0,
823
+ "default": null,
824
+ "generated": null,
825
+ "identity": null,
826
+ "name": "f_name",
827
+ "entityType": "columns",
828
+ "schema": "public",
829
+ "table": "t_storage_units"
830
+ },
831
+ {
832
+ "type": "integer",
833
+ "typeSchema": null,
834
+ "notNull": true,
835
+ "dimensions": 0,
836
+ "default": null,
837
+ "generated": null,
838
+ "identity": null,
839
+ "name": "f_version",
840
+ "entityType": "columns",
841
+ "schema": "public",
842
+ "table": "t_storage_units"
843
+ },
844
+ {
845
+ "type": "integer",
846
+ "typeSchema": null,
847
+ "notNull": true,
848
+ "dimensions": 0,
849
+ "default": null,
850
+ "generated": null,
851
+ "identity": null,
852
+ "name": "f_singleton",
853
+ "entityType": "columns",
854
+ "schema": "public",
855
+ "table": "t_workspace_state"
856
+ },
857
+ {
858
+ "type": "integer",
859
+ "typeSchema": null,
860
+ "notNull": true,
861
+ "dimensions": 0,
862
+ "default": null,
863
+ "generated": null,
864
+ "identity": null,
865
+ "name": "f_initialized",
866
+ "entityType": "columns",
867
+ "schema": "public",
868
+ "table": "t_workspace_state"
869
+ },
870
+ {
871
+ "type": "text",
872
+ "typeSchema": null,
873
+ "notNull": false,
874
+ "dimensions": 0,
875
+ "default": null,
876
+ "generated": null,
877
+ "identity": null,
878
+ "name": "f_pending_operation",
879
+ "entityType": "columns",
880
+ "schema": "public",
881
+ "table": "t_workspace_state"
882
+ },
883
+ {
884
+ "type": "text",
885
+ "typeSchema": null,
886
+ "notNull": false,
887
+ "dimensions": 0,
888
+ "default": null,
889
+ "generated": null,
890
+ "identity": null,
891
+ "name": "f_pending_workspace_id",
892
+ "entityType": "columns",
893
+ "schema": "public",
894
+ "table": "t_workspace_state"
895
+ },
896
+ {
897
+ "type": "serial",
898
+ "typeSchema": null,
899
+ "notNull": true,
900
+ "dimensions": 0,
901
+ "default": null,
902
+ "generated": null,
903
+ "identity": null,
904
+ "name": "f_id",
905
+ "entityType": "columns",
906
+ "schema": "public",
907
+ "table": "t_workspaces"
908
+ },
909
+ {
910
+ "type": "text",
911
+ "typeSchema": null,
912
+ "notNull": true,
913
+ "dimensions": 0,
914
+ "default": null,
915
+ "generated": null,
916
+ "identity": null,
917
+ "name": "f_workspace_id",
918
+ "entityType": "columns",
919
+ "schema": "public",
920
+ "table": "t_workspaces"
921
+ },
922
+ {
923
+ "type": "text",
924
+ "typeSchema": null,
925
+ "notNull": true,
926
+ "dimensions": 0,
927
+ "default": null,
928
+ "generated": null,
929
+ "identity": null,
930
+ "name": "f_path",
931
+ "entityType": "columns",
932
+ "schema": "public",
933
+ "table": "t_workspaces"
934
+ },
935
+ {
936
+ "type": "text",
937
+ "typeSchema": null,
938
+ "notNull": true,
939
+ "dimensions": 0,
940
+ "default": null,
941
+ "generated": null,
942
+ "identity": null,
943
+ "name": "f_title",
944
+ "entityType": "columns",
945
+ "schema": "public",
946
+ "table": "t_workspaces"
947
+ },
948
+ {
949
+ "type": "text",
950
+ "typeSchema": null,
951
+ "notNull": true,
952
+ "dimensions": 0,
953
+ "default": null,
954
+ "generated": null,
955
+ "identity": null,
956
+ "name": "f_created_at",
957
+ "entityType": "columns",
958
+ "schema": "public",
959
+ "table": "t_workspaces"
960
+ },
961
+ {
962
+ "type": "text",
963
+ "typeSchema": null,
964
+ "notNull": true,
965
+ "dimensions": 0,
966
+ "default": null,
967
+ "generated": null,
968
+ "identity": null,
969
+ "name": "f_updated_at",
970
+ "entityType": "columns",
971
+ "schema": "public",
972
+ "table": "t_workspaces"
973
+ },
974
+ {
975
+ "type": "integer",
976
+ "typeSchema": null,
977
+ "notNull": true,
978
+ "dimensions": 0,
979
+ "default": "-1",
980
+ "generated": null,
981
+ "identity": null,
982
+ "name": "f_position",
983
+ "entityType": "columns",
984
+ "schema": "public",
985
+ "table": "t_workspaces"
986
+ },
987
+ {
988
+ "type": "serial",
989
+ "typeSchema": null,
990
+ "notNull": true,
991
+ "dimensions": 0,
992
+ "default": null,
993
+ "generated": null,
994
+ "identity": null,
995
+ "name": "f_id",
996
+ "entityType": "columns",
997
+ "schema": "public",
998
+ "table": "t_workspace_sessions"
999
+ },
1000
+ {
1001
+ "type": "text",
1002
+ "typeSchema": null,
1003
+ "notNull": true,
1004
+ "dimensions": 0,
1005
+ "default": null,
1006
+ "generated": null,
1007
+ "identity": null,
1008
+ "name": "f_workspace_id",
1009
+ "entityType": "columns",
1010
+ "schema": "public",
1011
+ "table": "t_workspace_sessions"
1012
+ },
1013
+ {
1014
+ "type": "text",
1015
+ "typeSchema": null,
1016
+ "notNull": true,
1017
+ "dimensions": 0,
1018
+ "default": null,
1019
+ "generated": null,
1020
+ "identity": null,
1021
+ "name": "f_session_id",
1022
+ "entityType": "columns",
1023
+ "schema": "public",
1024
+ "table": "t_workspace_sessions"
1025
+ },
1026
+ {
1027
+ "type": "integer",
1028
+ "typeSchema": null,
1029
+ "notNull": true,
1030
+ "dimensions": 0,
1031
+ "default": null,
1032
+ "generated": null,
1033
+ "identity": null,
1034
+ "name": "f_position",
1035
+ "entityType": "columns",
1036
+ "schema": "public",
1037
+ "table": "t_workspace_sessions"
1038
+ },
1039
+ {
1040
+ "columns": ["f_id"],
1041
+ "nameExplicit": false,
1042
+ "name": "t_session_projcache_row_pkey",
1043
+ "schema": "public",
1044
+ "table": "t_session_projcache_row",
1045
+ "entityType": "pks"
1046
+ },
1047
+ {
1048
+ "columns": ["f_name"],
1049
+ "nameExplicit": false,
1050
+ "name": "t_storage_units_pkey",
1051
+ "schema": "public",
1052
+ "table": "t_storage_units",
1053
+ "entityType": "pks"
1054
+ },
1055
+ {
1056
+ "columns": ["f_singleton"],
1057
+ "nameExplicit": false,
1058
+ "name": "t_workspace_state_pkey",
1059
+ "schema": "public",
1060
+ "table": "t_workspace_state",
1061
+ "entityType": "pks"
1062
+ },
1063
+ {
1064
+ "columns": ["f_id"],
1065
+ "nameExplicit": false,
1066
+ "name": "t_workspaces_pkey",
1067
+ "schema": "public",
1068
+ "table": "t_workspaces",
1069
+ "entityType": "pks"
1070
+ },
1071
+ {
1072
+ "columns": ["f_id"],
1073
+ "nameExplicit": false,
1074
+ "name": "t_workspace_sessions_pkey",
1075
+ "schema": "public",
1076
+ "table": "t_workspace_sessions",
1077
+ "entityType": "pks"
1078
+ },
1079
+ {
1080
+ "columns": ["f_session_id", "f_key"],
1081
+ "nameExplicit": true,
1082
+ "name": "uq_session_projcache_row_session_key",
1083
+ "entityType": "uniques",
1084
+ "table": "t_session_projcache_row",
1085
+ "nullsNotDistinct": false,
1086
+ "schema": "public"
1087
+ },
1088
+ {
1089
+ "columns": ["f_workspace_id"],
1090
+ "nameExplicit": false,
1091
+ "name": "t_workspaces_f_workspace_id_unique",
1092
+ "entityType": "uniques",
1093
+ "table": "t_workspaces",
1094
+ "nullsNotDistinct": false,
1095
+ "schema": "public"
1096
+ },
1097
+ {
1098
+ "columns": ["f_workspace_id", "f_session_id"],
1099
+ "nameExplicit": true,
1100
+ "name": "uq_workspace_sessions_workspace_session",
1101
+ "entityType": "uniques",
1102
+ "table": "t_workspace_sessions",
1103
+ "nullsNotDistinct": false,
1104
+ "schema": "public"
1105
+ },
1106
+ {
1107
+ "nameExplicit": true,
1108
+ "columns": [
1109
+ {
1110
+ "value": "f_key",
1111
+ "isExpression": false,
1112
+ "asc": true,
1113
+ "nullsFirst": false,
1114
+ "opclass": null
1115
+ }
1116
+ ],
1117
+ "isUnique": false,
1118
+ "where": null,
1119
+ "with": "",
1120
+ "method": "btree",
1121
+ "concurrently": false,
1122
+ "name": "idx_session_projcache_row_key",
1123
+ "entityType": "indexes",
1124
+ "schema": "public",
1125
+ "table": "t_session_projcache_row"
1126
+ },
1127
+ {
1128
+ "nameExplicit": true,
1129
+ "columns": [
1130
+ {
1131
+ "value": "f_session_id",
1132
+ "isExpression": false,
1133
+ "asc": true,
1134
+ "nullsFirst": false,
1135
+ "opclass": null
1136
+ }
1137
+ ],
1138
+ "isUnique": false,
1139
+ "where": null,
1140
+ "with": "",
1141
+ "method": "btree",
1142
+ "concurrently": false,
1143
+ "name": "idx_workspace_sessions_session_id",
1144
+ "entityType": "indexes",
1145
+ "schema": "public",
1146
+ "table": "t_workspace_sessions"
1147
+ },
1148
+ {
1149
+ "value": "f_singleton = 1",
1150
+ "name": "ck_workspace_state_singleton",
1151
+ "entityType": "checks",
1152
+ "table": "t_workspace_state",
1153
+ "schema": "public"
1154
+ },
1155
+ {
1156
+ "columns": ["f_session_id"],
1157
+ "tableTo": "t_sessions",
1158
+ "columnsTo": ["f_session_id"],
1159
+ "onUpdate": "NO ACTION",
1160
+ "onDelete": "CASCADE",
1161
+ "nameExplicit": false,
1162
+ "name": "fk_t_session_projcache_row_f_session_id_t_sessions_f_session_id_fk",
1163
+ "entityType": "fks",
1164
+ "table": "t_session_projcache_row",
1165
+ "schemaTo": "public",
1166
+ "schema": "public"
1167
+ },
1168
+ {
1169
+ "columns": ["f_workspace_id"],
1170
+ "tableTo": "t_workspaces",
1171
+ "columnsTo": ["f_workspace_id"],
1172
+ "onUpdate": "NO ACTION",
1173
+ "onDelete": "CASCADE",
1174
+ "nameExplicit": false,
1175
+ "name": "fk_t_workspace_sessions_f_workspace_id_t_workspaces_f_workspace_id_fk",
1176
+ "entityType": "fks",
1177
+ "table": "t_workspace_sessions",
1178
+ "schemaTo": "public",
1179
+ "schema": "public"
1180
+ },
1181
+ {
1182
+ "name": "t_event_usage",
1183
+ "entityType": "tables"
1184
+ },
1185
+ {
1186
+ "type": "text",
1187
+ "notNull": true,
1188
+ "autoincrement": false,
1189
+ "default": "null",
1190
+ "generated": null,
1191
+ "name": "f_event_id",
1192
+ "entityType": "columns",
1193
+ "table": "t_event_usage"
1194
+ },
1195
+ {
1196
+ "type": "integer",
1197
+ "notNull": true,
1198
+ "autoincrement": false,
1199
+ "default": "null",
1200
+ "generated": null,
1201
+ "name": "f_created_at",
1202
+ "entityType": "columns",
1203
+ "table": "t_event_usage"
1204
+ },
1205
+ {
1206
+ "type": "text",
1207
+ "notNull": false,
1208
+ "autoincrement": false,
1209
+ "default": "null",
1210
+ "generated": null,
1211
+ "name": "f_provider",
1212
+ "entityType": "columns",
1213
+ "table": "t_event_usage"
1214
+ },
1215
+ {
1216
+ "type": "text",
1217
+ "notNull": false,
1218
+ "autoincrement": false,
1219
+ "default": "null",
1220
+ "generated": null,
1221
+ "name": "f_model",
1222
+ "entityType": "columns",
1223
+ "table": "t_event_usage"
1224
+ },
1225
+ {
1226
+ "type": "integer",
1227
+ "notNull": true,
1228
+ "autoincrement": false,
1229
+ "default": "0",
1230
+ "generated": null,
1231
+ "name": "f_input_tokens",
1232
+ "entityType": "columns",
1233
+ "table": "t_event_usage"
1234
+ },
1235
+ {
1236
+ "type": "integer",
1237
+ "notNull": true,
1238
+ "autoincrement": false,
1239
+ "default": "0",
1240
+ "generated": null,
1241
+ "name": "f_output_tokens",
1242
+ "entityType": "columns",
1243
+ "table": "t_event_usage"
1244
+ },
1245
+ {
1246
+ "type": "integer",
1247
+ "notNull": true,
1248
+ "autoincrement": false,
1249
+ "default": "0",
1250
+ "generated": null,
1251
+ "name": "f_cache_read_tokens",
1252
+ "entityType": "columns",
1253
+ "table": "t_event_usage"
1254
+ },
1255
+ {
1256
+ "type": "integer",
1257
+ "notNull": true,
1258
+ "autoincrement": false,
1259
+ "default": "0",
1260
+ "generated": null,
1261
+ "name": "f_reasoning_tokens",
1262
+ "entityType": "columns",
1263
+ "table": "t_event_usage"
1264
+ },
1265
+ {
1266
+ "type": "integer",
1267
+ "notNull": true,
1268
+ "autoincrement": false,
1269
+ "default": "0",
1270
+ "generated": null,
1271
+ "name": "f_total_tokens",
1272
+ "entityType": "columns",
1273
+ "table": "t_event_usage"
1274
+ },
1275
+ {
1276
+ "columns": ["f_event_id"],
1277
+ "nameExplicit": false,
1278
+ "name": "t_event_usage_pk",
1279
+ "table": "t_event_usage",
1280
+ "entityType": "pks"
1281
+ },
1282
+ {
1283
+ "columns": [
1284
+ {
1285
+ "value": "f_created_at",
1286
+ "isExpression": false
1287
+ }
1288
+ ],
1289
+ "isUnique": false,
1290
+ "where": null,
1291
+ "origin": "manual",
1292
+ "name": "idx_event_usage_created_at",
1293
+ "entityType": "indexes",
1294
+ "table": "t_event_usage"
1295
+ },
1296
+ {
1297
+ "columns": ["f_event_id"],
1298
+ "tableTo": "t_events",
1299
+ "columnsTo": ["f_event_id"],
1300
+ "onUpdate": "NO ACTION",
1301
+ "onDelete": "CASCADE",
1302
+ "nameExplicit": false,
1303
+ "name": "fk_t_event_usage_f_event_id_t_events_f_event_id_fk",
1304
+ "entityType": "fks",
1305
+ "table": "t_event_usage"
1306
+ }
1307
+ ],
1308
+ "renames": []
1309
+ }