@reventlessdev/reventless-postgres 3.0.0-alpha.201 → 3.0.0-alpha.203

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 (76) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lib/bs/.compiler.log +2 -2
  3. package/lib/bs/compiler-info.json +1 -1
  4. package/lib/bs/src/DcbEventLogStorage_Postgres-ReventlessPostgres.cmi +0 -0
  5. package/lib/bs/src/DcbEventLogStorage_Postgres-ReventlessPostgres.cmj +0 -0
  6. package/lib/bs/src/DcbEventLogStorage_Postgres-ReventlessPostgres.cmt +0 -0
  7. package/lib/bs/src/DcbEventLogStorage_Postgres.ast +0 -0
  8. package/lib/bs/src/DcbEventLogStorage_Postgres.res +1 -1
  9. package/lib/bs/src/DcbEventLogStorage_Postgres.res.mjs +6 -0
  10. package/lib/bs/src/DcbEventLogStorage_Postgres_Ops-ReventlessPostgres.cmi +0 -0
  11. package/lib/bs/src/DcbEventLogStorage_Postgres_Ops-ReventlessPostgres.cmj +0 -0
  12. package/lib/bs/src/DcbEventLogStorage_Postgres_Ops-ReventlessPostgres.cmt +0 -0
  13. package/lib/bs/src/DcbEventLogStorage_Postgres_Ops.ast +0 -0
  14. package/lib/bs/src/DcbEventLogStorage_Postgres_Ops.res +12 -4
  15. package/lib/bs/src/DcbEventLogStorage_Postgres_Ops.res.mjs +11 -0
  16. package/lib/bs/src/EventLogChangeFeed-ReventlessPostgres.cmi +0 -0
  17. package/lib/bs/src/EventLogChangeFeed-ReventlessPostgres.cmt +0 -0
  18. package/lib/bs/src/EventLogStorage_Postgres-ReventlessPostgres.cmi +0 -0
  19. package/lib/bs/src/EventLogStorage_Postgres-ReventlessPostgres.cmt +0 -0
  20. package/lib/bs/src/EventLogStorage_Postgres_Ops-ReventlessPostgres.cmi +0 -0
  21. package/lib/bs/src/EventLogStorage_Postgres_Ops-ReventlessPostgres.cmt +0 -0
  22. package/lib/bs/src/PgChangeFeed-ReventlessPostgres.cmi +0 -0
  23. package/lib/bs/src/PgChangeFeed-ReventlessPostgres.cmt +0 -0
  24. package/lib/bs/src/PgSchema-ReventlessPostgres.cmi +0 -0
  25. package/lib/bs/src/PgSchema-ReventlessPostgres.cmt +0 -0
  26. package/lib/bs/src/PgSchema.ast +0 -0
  27. package/lib/bs/src/PgSchema.res +1 -1
  28. package/lib/bs/src/QueryDbStorage_Postgres-ReventlessPostgres.cmi +0 -0
  29. package/lib/bs/src/QueryDbStorage_Postgres-ReventlessPostgres.cmt +0 -0
  30. package/lib/bs/src/QueryDbStorage_Postgres_Ops-ReventlessPostgres.cmi +0 -0
  31. package/lib/bs/src/QueryDbStorage_Postgres_Ops-ReventlessPostgres.cmt +0 -0
  32. package/lib/bs/src/QueryEnginePostgres-ReventlessPostgres.cmi +0 -0
  33. package/lib/bs/src/QueryEnginePostgres-ReventlessPostgres.cmt +0 -0
  34. package/lib/bs/tests/PostgresIntegrationTest-ReventlessPostgres.cmi +0 -0
  35. package/lib/bs/tests/PostgresIntegrationTest-ReventlessPostgres.cmt +0 -0
  36. package/lib/bs/tests/PostgresIntegrationTest.ast +0 -0
  37. package/lib/bs/tests/PostgresIntegrationTest.res +3 -3
  38. package/lib/bs/tests/QueryEnginePostgresListPageTest-ReventlessPostgres.cmi +0 -0
  39. package/lib/bs/tests/QueryEnginePostgresListPageTest-ReventlessPostgres.cmt +0 -0
  40. package/lib/ocaml/.compiler.log +2 -2
  41. package/lib/ocaml/DcbEventLogStorage_Postgres-ReventlessPostgres.cmi +0 -0
  42. package/lib/ocaml/DcbEventLogStorage_Postgres-ReventlessPostgres.cmj +0 -0
  43. package/lib/ocaml/DcbEventLogStorage_Postgres-ReventlessPostgres.cmt +0 -0
  44. package/lib/ocaml/DcbEventLogStorage_Postgres.ast +0 -0
  45. package/lib/ocaml/DcbEventLogStorage_Postgres.res +1 -1
  46. package/lib/ocaml/DcbEventLogStorage_Postgres_Ops-ReventlessPostgres.cmi +0 -0
  47. package/lib/ocaml/DcbEventLogStorage_Postgres_Ops-ReventlessPostgres.cmj +0 -0
  48. package/lib/ocaml/DcbEventLogStorage_Postgres_Ops-ReventlessPostgres.cmt +0 -0
  49. package/lib/ocaml/DcbEventLogStorage_Postgres_Ops.ast +0 -0
  50. package/lib/ocaml/DcbEventLogStorage_Postgres_Ops.res +12 -4
  51. package/lib/ocaml/EventLogChangeFeed-ReventlessPostgres.cmi +0 -0
  52. package/lib/ocaml/EventLogChangeFeed-ReventlessPostgres.cmt +0 -0
  53. package/lib/ocaml/EventLogStorage_Postgres-ReventlessPostgres.cmi +0 -0
  54. package/lib/ocaml/EventLogStorage_Postgres-ReventlessPostgres.cmt +0 -0
  55. package/lib/ocaml/EventLogStorage_Postgres_Ops-ReventlessPostgres.cmi +0 -0
  56. package/lib/ocaml/EventLogStorage_Postgres_Ops-ReventlessPostgres.cmt +0 -0
  57. package/lib/ocaml/PgChangeFeed-ReventlessPostgres.cmi +0 -0
  58. package/lib/ocaml/PgChangeFeed-ReventlessPostgres.cmt +0 -0
  59. package/lib/ocaml/PgSchema-ReventlessPostgres.cmi +0 -0
  60. package/lib/ocaml/PgSchema-ReventlessPostgres.cmt +0 -0
  61. package/lib/ocaml/PgSchema.ast +0 -0
  62. package/lib/ocaml/PgSchema.res +1 -1
  63. package/lib/ocaml/PostgresIntegrationTest.res +3 -3
  64. package/lib/ocaml/QueryDbStorage_Postgres-ReventlessPostgres.cmi +0 -0
  65. package/lib/ocaml/QueryDbStorage_Postgres-ReventlessPostgres.cmt +0 -0
  66. package/lib/ocaml/QueryDbStorage_Postgres_Ops-ReventlessPostgres.cmi +0 -0
  67. package/lib/ocaml/QueryDbStorage_Postgres_Ops-ReventlessPostgres.cmt +0 -0
  68. package/lib/ocaml/QueryEnginePostgres-ReventlessPostgres.cmi +0 -0
  69. package/lib/ocaml/QueryEnginePostgres-ReventlessPostgres.cmt +0 -0
  70. package/package.json +6 -6
  71. package/src/DcbEventLogStorage_Postgres.res +1 -1
  72. package/src/DcbEventLogStorage_Postgres.res.mjs +6 -0
  73. package/src/DcbEventLogStorage_Postgres_Ops.res +12 -4
  74. package/src/DcbEventLogStorage_Postgres_Ops.res.mjs +11 -0
  75. package/src/PgSchema.res +1 -1
  76. package/tests/PostgresIntegrationTest.res +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 3.0.0-alpha.203 (2026-11-15)
7
+
8
+ **Note:** Version bump only for package @reventlessdev/reventless-postgres
9
+
10
+
11
+
12
+
13
+
14
+ # 3.0.0-alpha.202 (2026-11-12)
15
+
16
+ **Note:** Version bump only for package @reventlessdev/reventless-postgres
17
+
18
+
19
+
20
+
21
+
6
22
  # 3.0.0-alpha.201 (2026-11-11)
7
23
 
8
24
  **Note:** Version bump only for package @reventlessdev/reventless-postgres
@@ -1,2 +1,2 @@
1
- #Start(1794356355005)
2
- #Done(1794356356488)
1
+ #Start(1794767340782)
2
+ #Done(1794767343230)
@@ -4,5 +4,5 @@
4
4
  "bsc_hash": "1006241435e8d5052329c523202a7fe6359a37e1e1688c023d37d6a7ebb5fb6d",
5
5
  "rescript_config_hash": "af2af60a0fa33b8249a96ff2758f36482843126dc4e07b9302842d011e0ad8c6",
6
6
  "runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
7
- "generated_at": "1794356356489"
7
+ "generated_at": "1794767343238"
8
8
  }
@@ -20,7 +20,7 @@ let makeStorage = (
20
20
  ~partitionTag,
21
21
  ~crossPartitionTagKeys=?,
22
22
  ~opts,
23
- ~lockStrategy: lockStrategy=#AdvisoryLocks,
23
+ ~lockStrategy: lockStrategy=AdvisoryLocks,
24
24
  ~onAppended=noTracking,
25
25
  ) => {
26
26
  let (name, ops) = makeOps(
@@ -18,6 +18,10 @@ function makeStorage(pool, name, indexes, partitionTag, crossPartitionTagKeys, o
18
18
  ];
19
19
  }
20
20
 
21
+ let lockStrategies = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.lockStrategies;
22
+
23
+ let lockStrategyOfName = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.lockStrategyOfName;
24
+
21
25
  let strategyParam = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.strategyParam;
22
26
 
23
27
  let noTracking = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.noTracking;
@@ -53,6 +57,8 @@ let positionsOfAppend = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.posit
53
57
  let makeOps = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.makeOps;
54
58
 
55
59
  export {
60
+ lockStrategies,
61
+ lockStrategyOfName,
56
62
  strategyParam,
57
63
  noTracking,
58
64
  selectColumns,
@@ -14,11 +14,19 @@ open Reventless
14
14
  // Lock strategy for concurrent appends (B4). Advisory (default) is safe under
15
15
  // PgBouncer transaction mode; RowLocks avoids advisory-lock connection pinning
16
16
  // on RDS Proxy at the cost of a companion `dcb_scope` table.
17
- type lockStrategy = [#AdvisoryLocks | #RowLocks]
17
+ // A connection config names it by the case's own name (`"RowLocks"`).
18
+ type lockStrategy = AdvisoryLocks | RowLocks
19
+
20
+ let lockStrategies = [AdvisoryLocks, RowLocks]
21
+
22
+ /** The strategy a connection config names; `None` for a name that names none. */
23
+ let lockStrategyOfName = (name: string): option<lockStrategy> =>
24
+ lockStrategies->Array.find(s => (s :> string) == name)
25
+
18
26
  let strategyParam = s =>
19
27
  switch s {
20
- | #AdvisoryLocks => "advisory"
21
- | #RowLocks => "rows"
28
+ | AdvisoryLocks => "advisory"
29
+ | RowLocks => "rows"
22
30
  }
23
31
 
24
32
  // Injected by reventless-local to feed the projection-checkpoint low-watermark
@@ -255,7 +263,7 @@ let makeOps = (
255
263
  ~partitionTag as _,
256
264
  ~crossPartitionTagKeys as _=?,
257
265
  ~opts as _,
258
- ~lockStrategy: lockStrategy=#AdvisoryLocks,
266
+ ~lockStrategy: lockStrategy=AdvisoryLocks,
259
267
  ~onAppended=noTracking,
260
268
  ): (string, DcbEventLog_Adapter.operations) => {
261
269
  // Fenced head cursor: the highest (transaction_id, position) visible under the
@@ -14,6 +14,15 @@ import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_excep
14
14
  import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
15
15
  import * as PgDriver$ReventlessPostgres from "./PgDriver.res.mjs";
16
16
 
17
+ let lockStrategies = [
18
+ "AdvisoryLocks",
19
+ "RowLocks"
20
+ ];
21
+
22
+ function lockStrategyOfName(name) {
23
+ return lockStrategies.find(s => s === name);
24
+ }
25
+
17
26
  function strategyParam(s) {
18
27
  if (s === "AdvisoryLocks") {
19
28
  return "advisory";
@@ -416,6 +425,8 @@ function makeOps(pool, name, param, param$1, param$2, param$3, lockStrategyOpt,
416
425
  let pageSize = 500;
417
426
 
418
427
  export {
428
+ lockStrategies,
429
+ lockStrategyOfName,
419
430
  strategyParam,
420
431
  noTracking,
421
432
  selectColumns,
Binary file
@@ -8,7 +8,7 @@
8
8
  // event_log / snapshot — classic OCC log (Phase A)
9
9
  // dcb_event — DCB log; positions are a global IDENTITY sequence,
10
10
  // rows stamped with the committing xid8 (Phase B)
11
- // dcb_scope — companion table for the #RowLocks strategy (B4)
11
+ // dcb_scope — companion table for the RowLocks strategy (B4)
12
12
  // dcb_subscription — change-feed checkpoints (Phase D)
13
13
  // dcb_condition_where(...) — compiles a DcbTag.query jsonb AST → SQL WHERE
14
14
  // dcb_append(...) — the concurrency-critical append (B1): scoped
@@ -10,7 +10,7 @@
10
10
  // - write-skew: two genuinely concurrent conditional appends on one boundary —
11
11
  // exactly one commits, the other conflicts cleanly (the anomaly the advisory
12
12
  // locks close)
13
- // - both #AdvisoryLocks and #RowLocks strategies
13
+ // - both AdvisoryLocks and RowLocks strategies
14
14
 
15
15
  open JestGlobals
16
16
  open ReventlessCore
@@ -184,8 +184,8 @@ switch processEnv->Dict.get("PG_URL") {
184
184
  },
185
185
  )
186
186
 
187
- writeSkew(#AdvisoryLocks, "dcb-skew-advisory")
188
- writeSkew(#RowLocks, "dcb-skew-rows")
187
+ writeSkew(AdvisoryLocks, "dcb-skew-advisory")
188
+ writeSkew(RowLocks, "dcb-skew-rows")
189
189
 
190
190
  testPromise("hot tag: N concurrent conditional appends, exactly one wins", async () => {
191
191
  let (_n, ops, _s) = makeLog("dcb-hot")
@@ -1,2 +1,2 @@
1
- #Start(1794356355005)
2
- #Done(1794356356488)
1
+ #Start(1794767340782)
2
+ #Done(1794767343230)
@@ -20,7 +20,7 @@ let makeStorage = (
20
20
  ~partitionTag,
21
21
  ~crossPartitionTagKeys=?,
22
22
  ~opts,
23
- ~lockStrategy: lockStrategy=#AdvisoryLocks,
23
+ ~lockStrategy: lockStrategy=AdvisoryLocks,
24
24
  ~onAppended=noTracking,
25
25
  ) => {
26
26
  let (name, ops) = makeOps(
@@ -14,11 +14,19 @@ open Reventless
14
14
  // Lock strategy for concurrent appends (B4). Advisory (default) is safe under
15
15
  // PgBouncer transaction mode; RowLocks avoids advisory-lock connection pinning
16
16
  // on RDS Proxy at the cost of a companion `dcb_scope` table.
17
- type lockStrategy = [#AdvisoryLocks | #RowLocks]
17
+ // A connection config names it by the case's own name (`"RowLocks"`).
18
+ type lockStrategy = AdvisoryLocks | RowLocks
19
+
20
+ let lockStrategies = [AdvisoryLocks, RowLocks]
21
+
22
+ /** The strategy a connection config names; `None` for a name that names none. */
23
+ let lockStrategyOfName = (name: string): option<lockStrategy> =>
24
+ lockStrategies->Array.find(s => (s :> string) == name)
25
+
18
26
  let strategyParam = s =>
19
27
  switch s {
20
- | #AdvisoryLocks => "advisory"
21
- | #RowLocks => "rows"
28
+ | AdvisoryLocks => "advisory"
29
+ | RowLocks => "rows"
22
30
  }
23
31
 
24
32
  // Injected by reventless-local to feed the projection-checkpoint low-watermark
@@ -255,7 +263,7 @@ let makeOps = (
255
263
  ~partitionTag as _,
256
264
  ~crossPartitionTagKeys as _=?,
257
265
  ~opts as _,
258
- ~lockStrategy: lockStrategy=#AdvisoryLocks,
266
+ ~lockStrategy: lockStrategy=AdvisoryLocks,
259
267
  ~onAppended=noTracking,
260
268
  ): (string, DcbEventLog_Adapter.operations) => {
261
269
  // Fenced head cursor: the highest (transaction_id, position) visible under the
Binary file
@@ -8,7 +8,7 @@
8
8
  // event_log / snapshot — classic OCC log (Phase A)
9
9
  // dcb_event — DCB log; positions are a global IDENTITY sequence,
10
10
  // rows stamped with the committing xid8 (Phase B)
11
- // dcb_scope — companion table for the #RowLocks strategy (B4)
11
+ // dcb_scope — companion table for the RowLocks strategy (B4)
12
12
  // dcb_subscription — change-feed checkpoints (Phase D)
13
13
  // dcb_condition_where(...) — compiles a DcbTag.query jsonb AST → SQL WHERE
14
14
  // dcb_append(...) — the concurrency-critical append (B1): scoped
@@ -10,7 +10,7 @@
10
10
  // - write-skew: two genuinely concurrent conditional appends on one boundary —
11
11
  // exactly one commits, the other conflicts cleanly (the anomaly the advisory
12
12
  // locks close)
13
- // - both #AdvisoryLocks and #RowLocks strategies
13
+ // - both AdvisoryLocks and RowLocks strategies
14
14
 
15
15
  open JestGlobals
16
16
  open ReventlessCore
@@ -184,8 +184,8 @@ switch processEnv->Dict.get("PG_URL") {
184
184
  },
185
185
  )
186
186
 
187
- writeSkew(#AdvisoryLocks, "dcb-skew-advisory")
188
- writeSkew(#RowLocks, "dcb-skew-rows")
187
+ writeSkew(AdvisoryLocks, "dcb-skew-advisory")
188
+ writeSkew(RowLocks, "dcb-skew-rows")
189
189
 
190
190
  testPromise("hot tag: N concurrent conditional appends, exactly one wins", async () => {
191
191
  let (_n, ops, _s) = makeLog("dcb-hot")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-postgres",
3
- "version": "3.0.0-alpha.201",
3
+ "version": "3.0.0-alpha.203",
4
4
  "description": "Postgres storage backend for Reventless (classic + DCB event logs, query DB, change feed). Connection-string only — RDS/Aurora, any managed provider, or a local container.",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -23,17 +23,17 @@
23
23
  "pg": "^8.13.1",
24
24
  "sury": "11.1.0",
25
25
  "@reventlessdev/rescript-effect": "1.0.0-alpha.3",
26
- "@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
27
- "@reventlessdev/reventless-core": "3.0.0-alpha.337",
28
26
  "@reventlessdev/rescript-jest": "1.0.0-alpha.13",
29
- "@reventlessdev/reventless-infra": "3.0.0-alpha.230",
30
- "@reventlessdev/reventless-spec": "3.0.0-alpha.199"
27
+ "@reventlessdev/reventless-core": "3.0.0-alpha.339",
28
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.232",
29
+ "@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
30
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.201"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/pg": "^8.11.10",
34
34
  "rescript": "12.3.1",
35
35
  "sury-ppx": "11.1.0",
36
- "@reventlessdev/reventless-ppx": "1.0.0-alpha.111"
36
+ "@reventlessdev/reventless-ppx": "1.0.0-alpha.113"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "rescript": "^12.3.1"
@@ -20,7 +20,7 @@ let makeStorage = (
20
20
  ~partitionTag,
21
21
  ~crossPartitionTagKeys=?,
22
22
  ~opts,
23
- ~lockStrategy: lockStrategy=#AdvisoryLocks,
23
+ ~lockStrategy: lockStrategy=AdvisoryLocks,
24
24
  ~onAppended=noTracking,
25
25
  ) => {
26
26
  let (name, ops) = makeOps(
@@ -18,6 +18,10 @@ function makeStorage(pool, name, indexes, partitionTag, crossPartitionTagKeys, o
18
18
  ];
19
19
  }
20
20
 
21
+ let lockStrategies = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.lockStrategies;
22
+
23
+ let lockStrategyOfName = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.lockStrategyOfName;
24
+
21
25
  let strategyParam = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.strategyParam;
22
26
 
23
27
  let noTracking = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.noTracking;
@@ -53,6 +57,8 @@ let positionsOfAppend = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.posit
53
57
  let makeOps = DcbEventLogStorage_Postgres_Ops$ReventlessPostgres.makeOps;
54
58
 
55
59
  export {
60
+ lockStrategies,
61
+ lockStrategyOfName,
56
62
  strategyParam,
57
63
  noTracking,
58
64
  selectColumns,
@@ -14,11 +14,19 @@ open Reventless
14
14
  // Lock strategy for concurrent appends (B4). Advisory (default) is safe under
15
15
  // PgBouncer transaction mode; RowLocks avoids advisory-lock connection pinning
16
16
  // on RDS Proxy at the cost of a companion `dcb_scope` table.
17
- type lockStrategy = [#AdvisoryLocks | #RowLocks]
17
+ // A connection config names it by the case's own name (`"RowLocks"`).
18
+ type lockStrategy = AdvisoryLocks | RowLocks
19
+
20
+ let lockStrategies = [AdvisoryLocks, RowLocks]
21
+
22
+ /** The strategy a connection config names; `None` for a name that names none. */
23
+ let lockStrategyOfName = (name: string): option<lockStrategy> =>
24
+ lockStrategies->Array.find(s => (s :> string) == name)
25
+
18
26
  let strategyParam = s =>
19
27
  switch s {
20
- | #AdvisoryLocks => "advisory"
21
- | #RowLocks => "rows"
28
+ | AdvisoryLocks => "advisory"
29
+ | RowLocks => "rows"
22
30
  }
23
31
 
24
32
  // Injected by reventless-local to feed the projection-checkpoint low-watermark
@@ -255,7 +263,7 @@ let makeOps = (
255
263
  ~partitionTag as _,
256
264
  ~crossPartitionTagKeys as _=?,
257
265
  ~opts as _,
258
- ~lockStrategy: lockStrategy=#AdvisoryLocks,
266
+ ~lockStrategy: lockStrategy=AdvisoryLocks,
259
267
  ~onAppended=noTracking,
260
268
  ): (string, DcbEventLog_Adapter.operations) => {
261
269
  // Fenced head cursor: the highest (transaction_id, position) visible under the
@@ -14,6 +14,15 @@ import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_excep
14
14
  import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
15
15
  import * as PgDriver$ReventlessPostgres from "./PgDriver.res.mjs";
16
16
 
17
+ let lockStrategies = [
18
+ "AdvisoryLocks",
19
+ "RowLocks"
20
+ ];
21
+
22
+ function lockStrategyOfName(name) {
23
+ return lockStrategies.find(s => s === name);
24
+ }
25
+
17
26
  function strategyParam(s) {
18
27
  if (s === "AdvisoryLocks") {
19
28
  return "advisory";
@@ -416,6 +425,8 @@ function makeOps(pool, name, param, param$1, param$2, param$3, lockStrategyOpt,
416
425
  let pageSize = 500;
417
426
 
418
427
  export {
428
+ lockStrategies,
429
+ lockStrategyOfName,
419
430
  strategyParam,
420
431
  noTracking,
421
432
  selectColumns,
package/src/PgSchema.res CHANGED
@@ -8,7 +8,7 @@
8
8
  // event_log / snapshot — classic OCC log (Phase A)
9
9
  // dcb_event — DCB log; positions are a global IDENTITY sequence,
10
10
  // rows stamped with the committing xid8 (Phase B)
11
- // dcb_scope — companion table for the #RowLocks strategy (B4)
11
+ // dcb_scope — companion table for the RowLocks strategy (B4)
12
12
  // dcb_subscription — change-feed checkpoints (Phase D)
13
13
  // dcb_condition_where(...) — compiles a DcbTag.query jsonb AST → SQL WHERE
14
14
  // dcb_append(...) — the concurrency-critical append (B1): scoped
@@ -10,7 +10,7 @@
10
10
  // - write-skew: two genuinely concurrent conditional appends on one boundary —
11
11
  // exactly one commits, the other conflicts cleanly (the anomaly the advisory
12
12
  // locks close)
13
- // - both #AdvisoryLocks and #RowLocks strategies
13
+ // - both AdvisoryLocks and RowLocks strategies
14
14
 
15
15
  open JestGlobals
16
16
  open ReventlessCore
@@ -184,8 +184,8 @@ switch processEnv->Dict.get("PG_URL") {
184
184
  },
185
185
  )
186
186
 
187
- writeSkew(#AdvisoryLocks, "dcb-skew-advisory")
188
- writeSkew(#RowLocks, "dcb-skew-rows")
187
+ writeSkew(AdvisoryLocks, "dcb-skew-advisory")
188
+ writeSkew(RowLocks, "dcb-skew-rows")
189
189
 
190
190
  testPromise("hot tag: N concurrent conditional appends, exactly one wins", async () => {
191
191
  let (_n, ops, _s) = makeLog("dcb-hot")