@lix-js/sdk 0.6.0-preview.3 → 0.6.0-preview.5

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 (235) hide show
  1. package/README.md +1 -1
  2. package/SKILL.md +105 -65
  3. package/dist/engine-wasm/index.js +4 -4
  4. package/dist/engine-wasm/wasm/lix_engine.d.ts +30 -6
  5. package/dist/engine-wasm/wasm/lix_engine.js +187 -117
  6. package/dist/engine-wasm/wasm/lix_engine.wasm +0 -0
  7. package/dist/engine-wasm/wasm/lix_engine.wasm.d.ts +14 -8
  8. package/dist/generated/builtin-schemas.d.ts +69 -69
  9. package/dist/generated/builtin-schemas.js +94 -94
  10. package/dist/open-lix.d.ts +42 -28
  11. package/dist/open-lix.js +49 -10
  12. package/dist/sqlite/index.js +86 -30
  13. package/dist-engine-src/README.md +3 -3
  14. package/dist-engine-src/src/backend/capabilities.rs +67 -0
  15. package/dist-engine-src/src/backend/conformance/baseline.rs +1127 -0
  16. package/dist-engine-src/src/backend/conformance/factory.rs +93 -0
  17. package/dist-engine-src/src/backend/conformance/failure_tests.rs +608 -0
  18. package/dist-engine-src/src/backend/conformance/fixtures.rs +26 -0
  19. package/dist-engine-src/src/backend/conformance/mod.rs +75 -0
  20. package/dist-engine-src/src/backend/conformance/model.rs +28 -0
  21. package/dist-engine-src/src/backend/conformance/model_based.rs +257 -0
  22. package/dist-engine-src/src/backend/conformance/persistence.rs +204 -0
  23. package/dist-engine-src/src/backend/conformance/projection.rs +21 -0
  24. package/dist-engine-src/src/backend/conformance/pushdown.rs +24 -0
  25. package/dist-engine-src/src/backend/conformance/runner.rs +90 -0
  26. package/dist-engine-src/src/backend/conformance/scan.rs +24 -0
  27. package/dist-engine-src/src/backend/conformance/write.rs +16 -0
  28. package/dist-engine-src/src/backend/error.rs +94 -0
  29. package/dist-engine-src/src/backend/in_memory.rs +670 -0
  30. package/dist-engine-src/src/backend/mod.rs +36 -9
  31. package/dist-engine-src/src/backend/predicate.rs +80 -0
  32. package/dist-engine-src/src/backend/traits.rs +260 -0
  33. package/dist-engine-src/src/backend/types.rs +224 -81
  34. package/dist-engine-src/src/binary_cas/context.rs +8 -8
  35. package/dist-engine-src/src/binary_cas/kv.rs +234 -259
  36. package/dist-engine-src/src/{version → branch}/context.rs +12 -12
  37. package/dist-engine-src/src/branch/lifecycle.rs +221 -0
  38. package/dist-engine-src/src/branch/mod.rs +13 -0
  39. package/dist-engine-src/src/branch/refs.rs +321 -0
  40. package/dist-engine-src/src/branch/stage_rows.rs +67 -0
  41. package/dist-engine-src/src/branch/types.rs +21 -0
  42. package/dist-engine-src/src/catalog/context.rs +18 -18
  43. package/dist-engine-src/src/catalog/snapshot.rs +8 -8
  44. package/dist-engine-src/src/changelog/bench_support.rs +785 -0
  45. package/dist-engine-src/src/changelog/change.rs +1 -0
  46. package/dist-engine-src/src/changelog/codec.rs +497 -0
  47. package/dist-engine-src/src/changelog/commit.rs +1 -0
  48. package/dist-engine-src/src/changelog/context.rs +1614 -0
  49. package/dist-engine-src/src/changelog/mod.rs +29 -0
  50. package/dist-engine-src/src/changelog/store.rs +163 -0
  51. package/dist-engine-src/src/changelog/test_support.rs +54 -0
  52. package/dist-engine-src/src/changelog/types.rs +213 -0
  53. package/dist-engine-src/src/commit_graph/context.rs +317 -274
  54. package/dist-engine-src/src/commit_graph/mod.rs +2 -4
  55. package/dist-engine-src/src/commit_graph/types.rs +22 -42
  56. package/dist-engine-src/src/commit_graph/walker.rs +133 -103
  57. package/dist-engine-src/src/common/error.rs +52 -18
  58. package/dist-engine-src/src/common/identity.rs +2 -2
  59. package/dist-engine-src/src/common/mod.rs +1 -1
  60. package/dist-engine-src/src/domain.rs +42 -46
  61. package/dist-engine-src/src/engine.rs +74 -96
  62. package/dist-engine-src/src/{entity_identity.rs → entity_pk.rs} +89 -92
  63. package/dist-engine-src/src/functions/context.rs +56 -52
  64. package/dist-engine-src/src/functions/state.rs +51 -52
  65. package/dist-engine-src/src/init.rs +288 -154
  66. package/dist-engine-src/src/json_store/context.rs +15 -266
  67. package/dist-engine-src/src/json_store/mod.rs +26 -0
  68. package/dist-engine-src/src/json_store/store.rs +103 -718
  69. package/dist-engine-src/src/json_store/types.rs +4 -9
  70. package/dist-engine-src/src/lib.rs +49 -19
  71. package/dist-engine-src/src/live_state/context.rs +654 -790
  72. package/dist-engine-src/src/live_state/mod.rs +9 -3
  73. package/dist-engine-src/src/live_state/overlay.rs +4 -4
  74. package/dist-engine-src/src/live_state/types.rs +30 -21
  75. package/dist-engine-src/src/live_state/visibility.rs +514 -71
  76. package/dist-engine-src/src/plugin/install.rs +48 -48
  77. package/dist-engine-src/src/plugin/manifest.rs +7 -7
  78. package/dist-engine-src/src/plugin/materializer.rs +0 -275
  79. package/dist-engine-src/src/plugin/plugin_manifest.json +4 -3
  80. package/dist-engine-src/src/schema/builtin/lix_binary_blob_ref.json +2 -2
  81. package/dist-engine-src/src/schema/builtin/lix_branch_descriptor.json +34 -0
  82. package/dist-engine-src/src/schema/builtin/lix_branch_ref.json +48 -0
  83. package/dist-engine-src/src/schema/builtin/lix_change.json +3 -3
  84. package/dist-engine-src/src/schema/builtin/lix_commit.json +1 -1
  85. package/dist-engine-src/src/schema/builtin/lix_label_assignment.json +6 -6
  86. package/dist-engine-src/src/schema/builtin/mod.rs +18 -20
  87. package/dist-engine-src/src/schema/compatibility.rs +11 -11
  88. package/dist-engine-src/src/schema/definition.json +2 -2
  89. package/dist-engine-src/src/schema/definition.rs +5 -5
  90. package/dist-engine-src/src/schema/key.rs +3 -3
  91. package/dist-engine-src/src/schema/mod.rs +1 -1
  92. package/dist-engine-src/src/schema/tests.rs +18 -18
  93. package/dist-engine-src/src/session/context.rs +819 -124
  94. package/dist-engine-src/src/session/create_branch.rs +94 -0
  95. package/dist-engine-src/src/session/execute.rs +260 -57
  96. package/dist-engine-src/src/session/merge/analysis.rs +9 -3
  97. package/dist-engine-src/src/session/merge/{version.rs → branch.rs} +119 -129
  98. package/dist-engine-src/src/session/merge/conflicts.rs +2 -2
  99. package/dist-engine-src/src/session/merge/mod.rs +5 -6
  100. package/dist-engine-src/src/session/merge/stats.rs +7 -11
  101. package/dist-engine-src/src/session/mod.rs +19 -16
  102. package/dist-engine-src/src/session/switch_branch.rs +113 -0
  103. package/dist-engine-src/src/session/transaction.rs +557 -0
  104. package/dist-engine-src/src/sql2/bind/classify.rs +102 -0
  105. package/dist-engine-src/src/sql2/bind/error.rs +5 -0
  106. package/dist-engine-src/src/sql2/bind/expr.rs +29 -0
  107. package/dist-engine-src/src/sql2/bind/mod.rs +12 -0
  108. package/dist-engine-src/src/sql2/{udfs/public_call.rs → bind/public_udf.rs} +98 -3
  109. package/dist-engine-src/src/sql2/bind/read.rs +65 -0
  110. package/dist-engine-src/src/sql2/bind/statement.rs +2236 -0
  111. package/dist-engine-src/src/sql2/bind/table.rs +273 -0
  112. package/dist-engine-src/src/sql2/bind/write.rs +86 -0
  113. package/dist-engine-src/src/sql2/branch_scope.rs +436 -0
  114. package/dist-engine-src/src/sql2/catalog/capability.rs +20 -0
  115. package/dist-engine-src/src/sql2/catalog/entity_surface.rs +296 -0
  116. package/dist-engine-src/src/sql2/catalog/mod.rs +15 -0
  117. package/dist-engine-src/src/sql2/catalog/registry.rs +556 -0
  118. package/dist-engine-src/src/sql2/catalog/schema.rs +88 -0
  119. package/dist-engine-src/src/sql2/catalog/surface.rs +41 -0
  120. package/dist-engine-src/src/sql2/change_materialization.rs +122 -0
  121. package/dist-engine-src/src/sql2/context.rs +36 -30
  122. package/dist-engine-src/src/sql2/error.rs +4 -5
  123. package/dist-engine-src/src/sql2/exec/bound_public_write.rs +1593 -0
  124. package/dist-engine-src/src/sql2/exec/datafusion.rs +5266 -0
  125. package/dist-engine-src/src/sql2/exec/fast_write.rs +82 -0
  126. package/dist-engine-src/src/sql2/exec/mod.rs +24 -0
  127. package/dist-engine-src/src/sql2/exec/write.rs +661 -0
  128. package/dist-engine-src/src/sql2/filesystem_planner.rs +72 -77
  129. package/dist-engine-src/src/sql2/filesystem_visibility.rs +21 -21
  130. package/dist-engine-src/src/sql2/history_projection.rs +8 -8
  131. package/dist-engine-src/src/sql2/history_route.rs +35 -31
  132. package/dist-engine-src/src/sql2/mod.rs +30 -24
  133. package/dist-engine-src/src/sql2/optimize/datafusion.rs +1 -0
  134. package/dist-engine-src/src/sql2/optimize/mod.rs +2 -0
  135. package/dist-engine-src/src/sql2/optimize/simple_write.rs +116 -0
  136. package/dist-engine-src/src/sql2/parse/mod.rs +69 -0
  137. package/dist-engine-src/src/sql2/parse/normalize.rs +1 -0
  138. package/dist-engine-src/src/sql2/plan/branch_scope.rs +24 -0
  139. package/dist-engine-src/src/sql2/plan/mod.rs +5 -0
  140. package/dist-engine-src/src/sql2/plan/predicate.rs +22 -0
  141. package/dist-engine-src/src/sql2/plan/write.rs +147 -0
  142. package/dist-engine-src/src/sql2/predicate_typecheck.rs +258 -0
  143. package/dist-engine-src/src/sql2/{version_provider.rs → providers/branch.rs} +218 -214
  144. package/dist-engine-src/src/sql2/{change_provider.rs → providers/change.rs} +156 -42
  145. package/dist-engine-src/src/sql2/{directory_provider.rs → providers/directory.rs} +291 -322
  146. package/dist-engine-src/src/sql2/{directory_history_provider.rs → providers/directory_history.rs} +56 -42
  147. package/dist-engine-src/src/sql2/providers/entity.rs +1484 -0
  148. package/dist-engine-src/src/sql2/{entity_history_provider.rs → providers/entity_history.rs} +43 -31
  149. package/dist-engine-src/src/sql2/{file_provider.rs → providers/file.rs} +323 -316
  150. package/dist-engine-src/src/sql2/{file_history_provider.rs → providers/file_history.rs} +60 -46
  151. package/dist-engine-src/src/sql2/{history_provider.rs → providers/history.rs} +46 -32
  152. package/dist-engine-src/src/sql2/{lix_state_provider.rs → providers/lix_state.rs} +359 -329
  153. package/dist-engine-src/src/sql2/providers/mod.rs +508 -0
  154. package/dist-engine-src/src/sql2/read_only.rs +2 -2
  155. package/dist-engine-src/src/sql2/session.rs +47 -96
  156. package/dist-engine-src/src/sql2/storage/constraints.rs +1 -0
  157. package/dist-engine-src/src/sql2/storage/mod.rs +1 -0
  158. package/dist-engine-src/src/sql2/test_support/differential.rs +712 -0
  159. package/dist-engine-src/src/sql2/test_support/generators.rs +354 -0
  160. package/dist-engine-src/src/sql2/test_support/mod.rs +2 -0
  161. package/dist-engine-src/src/sql2/udfs/{lix_active_version_commit_id.rs → lix_active_branch_commit_id.rs} +7 -7
  162. package/dist-engine-src/src/sql2/udfs/mod.rs +3 -6
  163. package/dist-engine-src/src/sql2/write_normalization.rs +45 -22
  164. package/dist-engine-src/src/storage/conformance.rs +399 -0
  165. package/dist-engine-src/src/storage/context.rs +552 -288
  166. package/dist-engine-src/src/storage/mod.rs +48 -10
  167. package/dist-engine-src/src/storage/point.rs +440 -0
  168. package/dist-engine-src/src/storage/read_scope.rs +43 -64
  169. package/dist-engine-src/src/storage/reader.rs +867 -0
  170. package/dist-engine-src/src/storage/scan.rs +784 -0
  171. package/dist-engine-src/src/storage/spaces.rs +236 -0
  172. package/dist-engine-src/src/storage/stats.rs +80 -0
  173. package/dist-engine-src/src/storage/write_set.rs +962 -0
  174. package/dist-engine-src/src/storage_bench.rs +136 -4828
  175. package/dist-engine-src/src/test_support.rs +360 -138
  176. package/dist-engine-src/src/tracked_state/bench_support.rs +394 -0
  177. package/dist-engine-src/src/tracked_state/codec.rs +155 -1057
  178. package/dist-engine-src/src/tracked_state/commit_root_rebuild.rs +358 -0
  179. package/dist-engine-src/src/tracked_state/context.rs +1927 -993
  180. package/dist-engine-src/src/tracked_state/diff.rs +1715 -261
  181. package/dist-engine-src/src/tracked_state/merge.rs +74 -88
  182. package/dist-engine-src/src/tracked_state/mod.rs +19 -16
  183. package/dist-engine-src/src/tracked_state/{materialization.rs → row_materialization.rs} +50 -178
  184. package/dist-engine-src/src/tracked_state/storage.rs +243 -191
  185. package/dist-engine-src/src/tracked_state/tree.rs +247 -371
  186. package/dist-engine-src/src/tracked_state/types.rs +49 -42
  187. package/dist-engine-src/src/transaction/bench_support.rs +407 -0
  188. package/dist-engine-src/src/transaction/commit.rs +821 -713
  189. package/dist-engine-src/src/transaction/context.rs +705 -600
  190. package/dist-engine-src/src/transaction/mod.rs +13 -2
  191. package/dist-engine-src/src/transaction/normalization.rs +63 -76
  192. package/dist-engine-src/src/transaction/prep.rs +13 -13
  193. package/dist-engine-src/src/transaction/schema_resolver.rs +19 -5
  194. package/dist-engine-src/src/transaction/staging.rs +228 -434
  195. package/dist-engine-src/src/transaction/types.rs +41 -98
  196. package/dist-engine-src/src/transaction/validation.rs +382 -446
  197. package/dist-engine-src/src/untracked_state/codec.rs +337 -29
  198. package/dist-engine-src/src/untracked_state/context.rs +7 -7
  199. package/dist-engine-src/src/untracked_state/materialization.rs +2 -2
  200. package/dist-engine-src/src/untracked_state/mod.rs +1 -1
  201. package/dist-engine-src/src/untracked_state/storage.rs +659 -157
  202. package/dist-engine-src/src/untracked_state/types.rs +21 -21
  203. package/package.json +71 -68
  204. package/dist-engine-src/src/backend/kv.rs +0 -358
  205. package/dist-engine-src/src/backend/testing.rs +0 -658
  206. package/dist-engine-src/src/commit_store/codec.rs +0 -887
  207. package/dist-engine-src/src/commit_store/context.rs +0 -944
  208. package/dist-engine-src/src/commit_store/materialization.rs +0 -84
  209. package/dist-engine-src/src/commit_store/mod.rs +0 -16
  210. package/dist-engine-src/src/commit_store/storage.rs +0 -600
  211. package/dist-engine-src/src/commit_store/types.rs +0 -215
  212. package/dist-engine-src/src/schema/builtin/lix_version_descriptor.json +0 -34
  213. package/dist-engine-src/src/schema/builtin/lix_version_ref.json +0 -48
  214. package/dist-engine-src/src/session/create_version.rs +0 -88
  215. package/dist-engine-src/src/session/merge/apply.rs +0 -23
  216. package/dist-engine-src/src/session/optimization9_sql2_bench.rs +0 -100
  217. package/dist-engine-src/src/session/switch_version.rs +0 -109
  218. package/dist-engine-src/src/sql2/classify.rs +0 -182
  219. package/dist-engine-src/src/sql2/entity_provider.rs +0 -3211
  220. package/dist-engine-src/src/sql2/execute.rs +0 -3440
  221. package/dist-engine-src/src/sql2/public_bind/assignment.rs +0 -46
  222. package/dist-engine-src/src/sql2/public_bind/capability.rs +0 -41
  223. package/dist-engine-src/src/sql2/public_bind/dml.rs +0 -166
  224. package/dist-engine-src/src/sql2/public_bind/mod.rs +0 -25
  225. package/dist-engine-src/src/sql2/public_bind/table.rs +0 -168
  226. package/dist-engine-src/src/sql2/version_scope.rs +0 -394
  227. package/dist-engine-src/src/storage/types.rs +0 -501
  228. package/dist-engine-src/src/tracked_state/by_file_index.rs +0 -98
  229. package/dist-engine-src/src/tracked_state/materializer.rs +0 -488
  230. package/dist-engine-src/src/transaction/live_state_overlay.rs +0 -35
  231. package/dist-engine-src/src/version/lifecycle.rs +0 -221
  232. package/dist-engine-src/src/version/mod.rs +0 -13
  233. package/dist-engine-src/src/version/refs.rs +0 -330
  234. package/dist-engine-src/src/version/stage_rows.rs +0 -67
  235. package/dist-engine-src/src/version/types.rs +0 -21
@@ -2,20 +2,26 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_lix_free: (a: number, b: number) => void;
5
- export const lix_activeVersionId: (a: number) => any;
5
+ export const __wbg_lixtransaction_free: (a: number, b: number) => void;
6
+ export const lix_activeBranchId: (a: number) => any;
7
+ export const lix_beginTransaction: (a: number) => any;
6
8
  export const lix_close: (a: number) => any;
7
- export const lix_createVersion: (a: number, b: any) => any;
9
+ export const lix_createBranch: (a: number, b: any) => any;
8
10
  export const lix_execute: (a: number, b: any, c: any) => any;
9
- export const lix_mergeVersion: (a: number, b: any) => any;
10
- export const lix_mergeVersionPreview: (a: number, b: any) => any;
11
- export const lix_switchVersion: (a: number, b: any) => any;
11
+ export const lix_mergeBranch: (a: number, b: any) => any;
12
+ export const lix_mergeBranchPreview: (a: number, b: any) => any;
13
+ export const lix_switchBranch: (a: number, b: any) => any;
14
+ export const lixtransaction_commit: (a: number) => any;
15
+ export const lixtransaction_execute: (a: number, b: any, c: any) => any;
16
+ export const lixtransaction_rollback: (a: number) => any;
12
17
  export const openLix: (a: number) => any;
13
- export const wasm_bindgen__closure__destroy__h259bf120b5b35fc5: (a: number, b: number) => void;
14
- export const wasm_bindgen__convert__closures_____invoke__h14bc79029e3672a5: (a: number, b: number, c: any, d: any) => void;
15
- export const wasm_bindgen__convert__closures_____invoke__ha15a27e9815e3c81: (a: number, b: number, c: any) => void;
18
+ export const wasm_bindgen_5d738226e03a83c7___convert__closures_____invoke___wasm_bindgen_5d738226e03a83c7___JsValue__core_df90f001dd94624b___result__Result_____wasm_bindgen_5d738226e03a83c7___JsError___true_: (a: number, b: number, c: any) => [number, number];
19
+ export const wasm_bindgen_5d738226e03a83c7___convert__closures_____invoke___js_sys_8745323a09a78a57___Function_fn_wasm_bindgen_5d738226e03a83c7___JsValue_____wasm_bindgen_5d738226e03a83c7___sys__Undefined___js_sys_8745323a09a78a57___Function_fn_wasm_bindgen_5d738226e03a83c7___JsValue_____wasm_bindgen_5d738226e03a83c7___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
16
20
  export const __wbindgen_malloc: (a: number, b: number) => number;
17
21
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
18
22
  export const __wbindgen_exn_store: (a: number) => void;
19
23
  export const __externref_table_alloc: () => number;
20
24
  export const __wbindgen_externrefs: WebAssembly.Table;
25
+ export const __wbindgen_destroy_closure: (a: number, b: number) => void;
26
+ export const __externref_table_dealloc: (a: number) => void;
21
27
  export const __wbindgen_start: () => void;
@@ -35,13 +35,13 @@ export declare const LixActiveAccountSchema: {
35
35
  };
36
36
  export declare const LixBinaryBlobRefSchema: {
37
37
  readonly "x-lix-key": "lix_binary_blob_ref";
38
- readonly description: "Metadata pointer from a file version to its binary payload in internal CAS storage.";
38
+ readonly description: "Metadata pointer from a file row to its binary payload in internal CAS storage.";
39
39
  readonly "x-lix-primary-key": readonly ["/id"];
40
40
  readonly type: "object";
41
41
  readonly properties: {
42
42
  readonly id: {
43
43
  readonly type: "string";
44
- readonly description: "File/entity identifier (matches lix_file.id) for this binary reference row.";
44
+ readonly description: "File primary-key value (matches lix_file.id) for this binary reference row.";
45
45
  };
46
46
  readonly blob_hash: {
47
47
  readonly type: "string";
@@ -56,6 +56,63 @@ export declare const LixBinaryBlobRefSchema: {
56
56
  readonly required: readonly ["id", "blob_hash", "size_bytes"];
57
57
  readonly additionalProperties: false;
58
58
  };
59
+ export declare const LixBranchDescriptorSchema: {
60
+ readonly "x-lix-key": "lix_branch_descriptor";
61
+ readonly description: "User-facing branch metadata (name and visibility). The stable identity of a branch; the matching `lix_branch_ref` carries the moving head pointer. The catalog's `lix_branch` surface joins this descriptor with its ref to present a single user-visible branch row.";
62
+ readonly "x-lix-primary-key": readonly ["/id"];
63
+ readonly "x-lix-unique": readonly [readonly ["/name"]];
64
+ readonly type: "object";
65
+ readonly properties: {
66
+ readonly id: {
67
+ readonly type: "string";
68
+ readonly "x-lix-default": "lix_uuid_v7()";
69
+ readonly description: "Stable branch identifier (UUIDv7). Referenced by `lix_branch_ref.id`.";
70
+ };
71
+ readonly name: {
72
+ readonly type: "string";
73
+ readonly description: "Human-readable branch name (e.g. `main`, `feature-x`) shown in branch listings and CLI output.";
74
+ };
75
+ readonly hidden: {
76
+ readonly type: "boolean";
77
+ readonly default: false;
78
+ readonly description: "When true, the branch is filtered from default listings (CLI, catalog views); operations by explicit id still succeed.";
79
+ };
80
+ };
81
+ readonly required: readonly ["id", "name"];
82
+ readonly additionalProperties: false;
83
+ };
84
+ export declare const LixBranchRefSchema: {
85
+ readonly "x-lix-key": "lix_branch_ref";
86
+ readonly description: "Branch head pointer. Records which commit a branch should currently resolve to in the local runtime. Intentionally not part of canonical commit membership: refs may be reset client-side after sync without introducing content conflicts. Each `lix_branch_descriptor.id` has exactly one `lix_branch_ref` row.";
87
+ readonly "x-lix-primary-key": readonly ["/id"];
88
+ readonly "x-lix-foreign-keys": readonly [{
89
+ readonly properties: readonly ["/id"];
90
+ readonly references: {
91
+ readonly schemaKey: "lix_branch_descriptor";
92
+ readonly properties: readonly ["/id"];
93
+ };
94
+ }, {
95
+ readonly properties: readonly ["/commit_id"];
96
+ readonly references: {
97
+ readonly schemaKey: "lix_commit";
98
+ readonly properties: readonly ["/id"];
99
+ };
100
+ }];
101
+ readonly type: "object";
102
+ readonly properties: {
103
+ readonly id: {
104
+ readonly type: "string";
105
+ readonly "x-lix-default": "lix_uuid_v7()";
106
+ readonly description: "Branch identifier whose head pointer is being stored; matches `lix_branch_descriptor.id`.";
107
+ };
108
+ readonly commit_id: {
109
+ readonly type: "string";
110
+ readonly description: "Commit the branch should currently resolve to in the local runtime (references `lix_commit.id`).";
111
+ };
112
+ };
113
+ readonly required: readonly ["id", "commit_id"];
114
+ readonly additionalProperties: false;
115
+ };
59
116
  export declare const LixChangeSchema: {
60
117
  readonly "x-lix-key": "lix_change";
61
118
  readonly description: "A change records one edit to a Lix entity, including what changed, when it changed, and which entity was affected.";
@@ -67,7 +124,7 @@ export declare const LixChangeSchema: {
67
124
  readonly "x-lix-default": "lix_uuid_v7()";
68
125
  readonly description: "Stable identifier for this change.";
69
126
  };
70
- readonly entity_id: {
127
+ readonly entity_pk: {
71
128
  readonly type: "array";
72
129
  readonly description: "Canonical JSON primary-key tuple for the entity this change applies to, scoped by (`schema_key`, `file_id`). Values are ordered according to the target schema's `x-lix-primary-key`.";
73
130
  readonly items: {
@@ -81,7 +138,7 @@ export declare const LixChangeSchema: {
81
138
  };
82
139
  readonly file_id: {
83
140
  readonly type: readonly ["string", "null"];
84
- readonly description: "Filesystem-scoped file identifier when the change belongs to a file; NULL for engine-internal entities (commits, versions, settings).";
141
+ readonly description: "Filesystem-scoped file identifier when the change belongs to a file; NULL for engine-internal entities (commits, branches, settings).";
85
142
  };
86
143
  readonly metadata: {
87
144
  readonly type: readonly ["object", "null"];
@@ -97,7 +154,7 @@ export declare const LixChangeSchema: {
97
154
  readonly description: "Entity JSON body at this change; NULL represents a tombstone (deletion).";
98
155
  };
99
156
  };
100
- readonly required: readonly ["id", "entity_id", "schema_key", "file_id", "created_at"];
157
+ readonly required: readonly ["id", "entity_pk", "schema_key", "file_id", "created_at"];
101
158
  readonly additionalProperties: false;
102
159
  };
103
160
  export declare const LixChangeAuthorSchema: {
@@ -130,7 +187,7 @@ export declare const LixChangeAuthorSchema: {
130
187
  };
131
188
  export declare const LixCommitSchema: {
132
189
  readonly "x-lix-key": "lix_commit";
133
- readonly description: "A commit is a stable point in project history. Versions point to commits. Use lix_commit_edge to inspect parent commits.";
190
+ readonly description: "A commit is a stable point in project history. Branches point to commits. Use lix_commit_edge to inspect parent commits.";
134
191
  readonly examples: readonly [{
135
192
  readonly id: "commit_01jexample";
136
193
  }];
@@ -307,10 +364,10 @@ export declare const LixLabelSchema: {
307
364
  };
308
365
  export declare const LixLabelAssignmentSchema: {
309
366
  readonly "x-lix-key": "lix_label_assignment";
310
- readonly description: "Mapping table that assigns a label to any live Lix row addressed by (target_entity_id, target_schema_key, target_file_id). The state foreign-key tuple is ordered as [0] target_entity_id, [1] target_schema_key, [2] target_file_id.";
367
+ readonly description: "Mapping table that assigns a label to any live Lix row addressed by (target_entity_pk, target_schema_key, target_file_id). The state foreign-key tuple is ordered as [0] target_entity_pk, [1] target_schema_key, [2] target_file_id.";
311
368
  readonly "x-lix-primary-key": readonly ["/id"];
312
- readonly "x-lix-unique": readonly [readonly ["/target_entity_id", "/target_schema_key", "/target_file_id", "/label_id"]];
313
- readonly "x-lix-state-foreign-keys": readonly [readonly ["/target_entity_id", "/target_schema_key", "/target_file_id"]];
369
+ readonly "x-lix-unique": readonly [readonly ["/target_entity_pk", "/target_schema_key", "/target_file_id", "/label_id"]];
370
+ readonly "x-lix-state-foreign-keys": readonly [readonly ["/target_entity_pk", "/target_schema_key", "/target_file_id"]];
314
371
  readonly "x-lix-foreign-keys": readonly [{
315
372
  readonly properties: readonly ["/label_id"];
316
373
  readonly references: {
@@ -325,9 +382,9 @@ export declare const LixLabelAssignmentSchema: {
325
382
  readonly "x-lix-default": "lix_uuid_v7()";
326
383
  readonly description: "Stable identifier for this label assignment row.";
327
384
  };
328
- readonly target_entity_id: {
385
+ readonly target_entity_pk: {
329
386
  readonly type: "array";
330
- readonly description: "Target row entity_id. This is slot [0] in x-lix-state-foreign-keys and must be the canonical JSON array of string primary-key parts.";
387
+ readonly description: "Target row entity_pk. This is slot [0] in x-lix-state-foreign-keys and must be the canonical JSON array of string primary-key parts.";
331
388
  readonly items: {
332
389
  readonly type: "string";
333
390
  };
@@ -346,7 +403,7 @@ export declare const LixLabelAssignmentSchema: {
346
403
  readonly description: "Label assigned to the target row. References lix_label.id.";
347
404
  };
348
405
  };
349
- readonly required: readonly ["id", "target_entity_id", "target_schema_key", "target_file_id", "label_id"];
406
+ readonly required: readonly ["id", "target_entity_pk", "target_schema_key", "target_file_id", "label_id"];
350
407
  readonly additionalProperties: false;
351
408
  };
352
409
  export declare const LixRegisteredSchemaSchema: {
@@ -368,60 +425,3 @@ export declare const LixRegisteredSchemaSchema: {
368
425
  readonly required: readonly ["value"];
369
426
  readonly additionalProperties: false;
370
427
  };
371
- export declare const LixVersionDescriptorSchema: {
372
- readonly "x-lix-key": "lix_version_descriptor";
373
- readonly description: "User-facing version metadata (name and visibility) for a branch-like version. The stable identity of a version; the matching `lix_version_ref` carries the moving head pointer. The catalog's `lix_version` surface joins this descriptor with its ref to present a single user-visible version row.";
374
- readonly "x-lix-primary-key": readonly ["/id"];
375
- readonly "x-lix-unique": readonly [readonly ["/name"]];
376
- readonly type: "object";
377
- readonly properties: {
378
- readonly id: {
379
- readonly type: "string";
380
- readonly "x-lix-default": "lix_uuid_v7()";
381
- readonly description: "Stable version identifier (UUIDv7). Referenced by `lix_version_ref.id`.";
382
- };
383
- readonly name: {
384
- readonly type: "string";
385
- readonly description: "Human-readable version name (e.g. `main`, `feature-x`) shown in version listings and CLI output.";
386
- };
387
- readonly hidden: {
388
- readonly type: "boolean";
389
- readonly default: false;
390
- readonly description: "When true, the version is filtered from default listings (CLI, catalog views); operations by explicit id still succeed.";
391
- };
392
- };
393
- readonly required: readonly ["id", "name"];
394
- readonly additionalProperties: false;
395
- };
396
- export declare const LixVersionRefSchema: {
397
- readonly "x-lix-key": "lix_version_ref";
398
- readonly description: "Version head pointer. Records which commit a version should currently resolve to in the local runtime. Intentionally not part of canonical commit membership: refs may be reset client-side after sync without introducing content conflicts. Each `lix_version_descriptor.id` has exactly one `lix_version_ref` row.";
399
- readonly "x-lix-primary-key": readonly ["/id"];
400
- readonly "x-lix-foreign-keys": readonly [{
401
- readonly properties: readonly ["/id"];
402
- readonly references: {
403
- readonly schemaKey: "lix_version_descriptor";
404
- readonly properties: readonly ["/id"];
405
- };
406
- }, {
407
- readonly properties: readonly ["/commit_id"];
408
- readonly references: {
409
- readonly schemaKey: "lix_commit";
410
- readonly properties: readonly ["/id"];
411
- };
412
- }];
413
- readonly type: "object";
414
- readonly properties: {
415
- readonly id: {
416
- readonly type: "string";
417
- readonly "x-lix-default": "lix_uuid_v7()";
418
- readonly description: "Version identifier whose head pointer is being stored; matches `lix_version_descriptor.id`.";
419
- };
420
- readonly commit_id: {
421
- readonly type: "string";
422
- readonly description: "Commit the version should currently resolve to in the local runtime (references `lix_commit.id`).";
423
- };
424
- };
425
- readonly required: readonly ["id", "commit_id"];
426
- readonly additionalProperties: false;
427
- };
@@ -52,7 +52,7 @@ export const LixActiveAccountSchema = {
52
52
  };
53
53
  export const LixBinaryBlobRefSchema = {
54
54
  "x-lix-key": "lix_binary_blob_ref",
55
- "description": "Metadata pointer from a file version to its binary payload in internal CAS storage.",
55
+ "description": "Metadata pointer from a file row to its binary payload in internal CAS storage.",
56
56
  "x-lix-primary-key": [
57
57
  "/id"
58
58
  ],
@@ -60,7 +60,7 @@ export const LixBinaryBlobRefSchema = {
60
60
  "properties": {
61
61
  "id": {
62
62
  "type": "string",
63
- "description": "File/entity identifier (matches lix_file.id) for this binary reference row."
63
+ "description": "File primary-key value (matches lix_file.id) for this binary reference row."
64
64
  },
65
65
  "blob_hash": {
66
66
  "type": "string",
@@ -79,6 +79,88 @@ export const LixBinaryBlobRefSchema = {
79
79
  ],
80
80
  "additionalProperties": false
81
81
  };
82
+ export const LixBranchDescriptorSchema = {
83
+ "x-lix-key": "lix_branch_descriptor",
84
+ "description": "User-facing branch metadata (name and visibility). The stable identity of a branch; the matching `lix_branch_ref` carries the moving head pointer. The catalog's `lix_branch` surface joins this descriptor with its ref to present a single user-visible branch row.",
85
+ "x-lix-primary-key": [
86
+ "/id"
87
+ ],
88
+ "x-lix-unique": [
89
+ [
90
+ "/name"
91
+ ]
92
+ ],
93
+ "type": "object",
94
+ "properties": {
95
+ "id": {
96
+ "type": "string",
97
+ "x-lix-default": "lix_uuid_v7()",
98
+ "description": "Stable branch identifier (UUIDv7). Referenced by `lix_branch_ref.id`."
99
+ },
100
+ "name": {
101
+ "type": "string",
102
+ "description": "Human-readable branch name (e.g. `main`, `feature-x`) shown in branch listings and CLI output."
103
+ },
104
+ "hidden": {
105
+ "type": "boolean",
106
+ "default": false,
107
+ "description": "When true, the branch is filtered from default listings (CLI, catalog views); operations by explicit id still succeed."
108
+ }
109
+ },
110
+ "required": [
111
+ "id",
112
+ "name"
113
+ ],
114
+ "additionalProperties": false
115
+ };
116
+ export const LixBranchRefSchema = {
117
+ "x-lix-key": "lix_branch_ref",
118
+ "description": "Branch head pointer. Records which commit a branch should currently resolve to in the local runtime. Intentionally not part of canonical commit membership: refs may be reset client-side after sync without introducing content conflicts. Each `lix_branch_descriptor.id` has exactly one `lix_branch_ref` row.",
119
+ "x-lix-primary-key": [
120
+ "/id"
121
+ ],
122
+ "x-lix-foreign-keys": [
123
+ {
124
+ "properties": [
125
+ "/id"
126
+ ],
127
+ "references": {
128
+ "schemaKey": "lix_branch_descriptor",
129
+ "properties": [
130
+ "/id"
131
+ ]
132
+ }
133
+ },
134
+ {
135
+ "properties": [
136
+ "/commit_id"
137
+ ],
138
+ "references": {
139
+ "schemaKey": "lix_commit",
140
+ "properties": [
141
+ "/id"
142
+ ]
143
+ }
144
+ }
145
+ ],
146
+ "type": "object",
147
+ "properties": {
148
+ "id": {
149
+ "type": "string",
150
+ "x-lix-default": "lix_uuid_v7()",
151
+ "description": "Branch identifier whose head pointer is being stored; matches `lix_branch_descriptor.id`."
152
+ },
153
+ "commit_id": {
154
+ "type": "string",
155
+ "description": "Commit the branch should currently resolve to in the local runtime (references `lix_commit.id`)."
156
+ }
157
+ },
158
+ "required": [
159
+ "id",
160
+ "commit_id"
161
+ ],
162
+ "additionalProperties": false
163
+ };
82
164
  export const LixChangeSchema = {
83
165
  "x-lix-key": "lix_change",
84
166
  "description": "A change records one edit to a Lix entity, including what changed, when it changed, and which entity was affected.",
@@ -92,7 +174,7 @@ export const LixChangeSchema = {
92
174
  "x-lix-default": "lix_uuid_v7()",
93
175
  "description": "Stable identifier for this change."
94
176
  },
95
- "entity_id": {
177
+ "entity_pk": {
96
178
  "type": "array",
97
179
  "description": "Canonical JSON primary-key tuple for the entity this change applies to, scoped by (`schema_key`, `file_id`). Values are ordered according to the target schema's `x-lix-primary-key`.",
98
180
  "items": {
@@ -109,7 +191,7 @@ export const LixChangeSchema = {
109
191
  "string",
110
192
  "null"
111
193
  ],
112
- "description": "Filesystem-scoped file identifier when the change belongs to a file; NULL for engine-internal entities (commits, versions, settings)."
194
+ "description": "Filesystem-scoped file identifier when the change belongs to a file; NULL for engine-internal entities (commits, branches, settings)."
113
195
  },
114
196
  "metadata": {
115
197
  "type": [
@@ -135,7 +217,7 @@ export const LixChangeSchema = {
135
217
  },
136
218
  "required": [
137
219
  "id",
138
- "entity_id",
220
+ "entity_pk",
139
221
  "schema_key",
140
222
  "file_id",
141
223
  "created_at"
@@ -189,7 +271,7 @@ export const LixChangeAuthorSchema = {
189
271
  };
190
272
  export const LixCommitSchema = {
191
273
  "x-lix-key": "lix_commit",
192
- "description": "A commit is a stable point in project history. Versions point to commits. Use lix_commit_edge to inspect parent commits.",
274
+ "description": "A commit is a stable point in project history. Branches point to commits. Use lix_commit_edge to inspect parent commits.",
193
275
  "examples": [
194
276
  {
195
277
  "id": "commit_01jexample"
@@ -462,13 +544,13 @@ export const LixLabelSchema = {
462
544
  };
463
545
  export const LixLabelAssignmentSchema = {
464
546
  "x-lix-key": "lix_label_assignment",
465
- "description": "Mapping table that assigns a label to any live Lix row addressed by (target_entity_id, target_schema_key, target_file_id). The state foreign-key tuple is ordered as [0] target_entity_id, [1] target_schema_key, [2] target_file_id.",
547
+ "description": "Mapping table that assigns a label to any live Lix row addressed by (target_entity_pk, target_schema_key, target_file_id). The state foreign-key tuple is ordered as [0] target_entity_pk, [1] target_schema_key, [2] target_file_id.",
466
548
  "x-lix-primary-key": [
467
549
  "/id"
468
550
  ],
469
551
  "x-lix-unique": [
470
552
  [
471
- "/target_entity_id",
553
+ "/target_entity_pk",
472
554
  "/target_schema_key",
473
555
  "/target_file_id",
474
556
  "/label_id"
@@ -476,7 +558,7 @@ export const LixLabelAssignmentSchema = {
476
558
  ],
477
559
  "x-lix-state-foreign-keys": [
478
560
  [
479
- "/target_entity_id",
561
+ "/target_entity_pk",
480
562
  "/target_schema_key",
481
563
  "/target_file_id"
482
564
  ]
@@ -501,9 +583,9 @@ export const LixLabelAssignmentSchema = {
501
583
  "x-lix-default": "lix_uuid_v7()",
502
584
  "description": "Stable identifier for this label assignment row."
503
585
  },
504
- "target_entity_id": {
586
+ "target_entity_pk": {
505
587
  "type": "array",
506
- "description": "Target row entity_id. This is slot [0] in x-lix-state-foreign-keys and must be the canonical JSON array of string primary-key parts.",
588
+ "description": "Target row entity_pk. This is slot [0] in x-lix-state-foreign-keys and must be the canonical JSON array of string primary-key parts.",
507
589
  "items": {
508
590
  "type": "string"
509
591
  },
@@ -527,7 +609,7 @@ export const LixLabelAssignmentSchema = {
527
609
  },
528
610
  "required": [
529
611
  "id",
530
- "target_entity_id",
612
+ "target_entity_pk",
531
613
  "target_schema_key",
532
614
  "target_file_id",
533
615
  "label_id"
@@ -559,85 +641,3 @@ export const LixRegisteredSchemaSchema = {
559
641
  ],
560
642
  "additionalProperties": false
561
643
  };
562
- export const LixVersionDescriptorSchema = {
563
- "x-lix-key": "lix_version_descriptor",
564
- "description": "User-facing version metadata (name and visibility) for a branch-like version. The stable identity of a version; the matching `lix_version_ref` carries the moving head pointer. The catalog's `lix_version` surface joins this descriptor with its ref to present a single user-visible version row.",
565
- "x-lix-primary-key": [
566
- "/id"
567
- ],
568
- "x-lix-unique": [
569
- [
570
- "/name"
571
- ]
572
- ],
573
- "type": "object",
574
- "properties": {
575
- "id": {
576
- "type": "string",
577
- "x-lix-default": "lix_uuid_v7()",
578
- "description": "Stable version identifier (UUIDv7). Referenced by `lix_version_ref.id`."
579
- },
580
- "name": {
581
- "type": "string",
582
- "description": "Human-readable version name (e.g. `main`, `feature-x`) shown in version listings and CLI output."
583
- },
584
- "hidden": {
585
- "type": "boolean",
586
- "default": false,
587
- "description": "When true, the version is filtered from default listings (CLI, catalog views); operations by explicit id still succeed."
588
- }
589
- },
590
- "required": [
591
- "id",
592
- "name"
593
- ],
594
- "additionalProperties": false
595
- };
596
- export const LixVersionRefSchema = {
597
- "x-lix-key": "lix_version_ref",
598
- "description": "Version head pointer. Records which commit a version should currently resolve to in the local runtime. Intentionally not part of canonical commit membership: refs may be reset client-side after sync without introducing content conflicts. Each `lix_version_descriptor.id` has exactly one `lix_version_ref` row.",
599
- "x-lix-primary-key": [
600
- "/id"
601
- ],
602
- "x-lix-foreign-keys": [
603
- {
604
- "properties": [
605
- "/id"
606
- ],
607
- "references": {
608
- "schemaKey": "lix_version_descriptor",
609
- "properties": [
610
- "/id"
611
- ]
612
- }
613
- },
614
- {
615
- "properties": [
616
- "/commit_id"
617
- ],
618
- "references": {
619
- "schemaKey": "lix_commit",
620
- "properties": [
621
- "/id"
622
- ]
623
- }
624
- }
625
- ],
626
- "type": "object",
627
- "properties": {
628
- "id": {
629
- "type": "string",
630
- "x-lix-default": "lix_uuid_v7()",
631
- "description": "Version identifier whose head pointer is being stored; matches `lix_version_descriptor.id`."
632
- },
633
- "commit_id": {
634
- "type": "string",
635
- "description": "Commit the version should currently resolve to in the local runtime (references `lix_commit.id`)."
636
- }
637
- },
638
- "required": [
639
- "id",
640
- "commit_id"
641
- ],
642
- "additionalProperties": false
643
- };
@@ -78,21 +78,28 @@ export type BackendKvEntryPage = {
78
78
  values: Uint8Array[];
79
79
  resumeAfter?: Uint8Array | null;
80
80
  };
81
- export type BackendKvPut = {
81
+ export type BackendKvWriteOp = {
82
+ kind: "put";
82
83
  key: Uint8Array;
83
84
  value: Uint8Array;
85
+ } | {
86
+ kind: "delete";
87
+ key: Uint8Array;
88
+ } | {
89
+ kind: "deleteRange";
90
+ range: BackendKvScanRange;
84
91
  };
85
92
  export type BackendKvWriteBatch = {
86
93
  groups: BackendKvWriteGroup[];
87
94
  };
88
95
  export type BackendKvWriteGroup = {
89
96
  namespace: string;
90
- puts: BackendKvPut[];
91
- deletes: Uint8Array[];
97
+ ops: BackendKvWriteOp[];
92
98
  };
93
99
  export type BackendKvWriteStats = {
94
100
  puts: number;
95
101
  deletes: number;
102
+ deleteRanges: number;
96
103
  bytesWritten: number;
97
104
  };
98
105
  export type LixBackendReadTransaction = {
@@ -115,35 +122,35 @@ export type LixBackend = {
115
122
  export type OpenLixOptions = {
116
123
  backend?: LixBackend;
117
124
  };
118
- export type CreateVersionOptions = {
125
+ export type CreateBranchOptions = {
119
126
  id?: string;
120
127
  name: string;
121
128
  fromCommitId?: string;
122
129
  };
123
- export type CreateVersionResult = {
130
+ export type CreateBranchResult = {
124
131
  id: string;
125
132
  name: string;
126
133
  hidden: boolean;
127
134
  commitId: string;
128
135
  };
129
- export type SwitchVersionOptions = {
130
- versionId: string;
136
+ export type SwitchBranchOptions = {
137
+ branchId: string;
131
138
  };
132
- export type SwitchVersionResult = {
133
- versionId: string;
139
+ export type SwitchBranchResult = {
140
+ branchId: string;
134
141
  };
135
- export type MergeVersionOptions = {
136
- sourceVersionId: string;
142
+ export type MergeBranchOptions = {
143
+ sourceBranchId: string;
137
144
  };
138
- export type MergeVersionOutcome = "alreadyUpToDate" | "fastForward" | "mergeCommitted";
139
- export type MergeVersionResult = {
145
+ export type MergeBranchOutcome = "alreadyUpToDate" | "fastForward" | "mergeCommitted";
146
+ export type MergeBranchResult = {
140
147
  /**
141
148
  * How the merge was applied. `fastForward` advances the target ref without
142
149
  * creating a merge commit, but can still make source changes visible.
143
150
  */
144
- outcome: MergeVersionOutcome;
145
- targetVersionId: string;
146
- sourceVersionId: string;
151
+ outcome: MergeBranchOutcome;
152
+ targetBranchId: string;
153
+ sourceBranchId: string;
147
154
  baseCommitId: string;
148
155
  targetHeadBeforeCommitId: string;
149
156
  sourceHeadBeforeCommitId: string;
@@ -151,10 +158,10 @@ export type MergeVersionResult = {
151
158
  createdMergeCommitId: string | null;
152
159
  changeStats: MergeChangeStats;
153
160
  };
154
- export type MergeVersionPreviewResult = {
155
- outcome: MergeVersionOutcome;
156
- targetVersionId: string;
157
- sourceVersionId: string;
161
+ export type MergeBranchPreviewResult = {
162
+ outcome: MergeBranchOutcome;
163
+ targetBranchId: string;
164
+ sourceBranchId: string;
158
165
  baseCommitId: string;
159
166
  targetHeadCommitId: string;
160
167
  sourceHeadCommitId: string;
@@ -170,7 +177,7 @@ export type MergeChangeStats = {
170
177
  export type MergeConflict = {
171
178
  kind: "sameEntityChanged";
172
179
  schemaKey: string;
173
- entityId: string[];
180
+ entityPk: string[];
174
181
  fileId: string | null;
175
182
  target: MergeConflictSide;
176
183
  source: MergeConflictSide;
@@ -185,16 +192,23 @@ export type Lix = {
185
192
  * Executes one DataFusion SQL statement against this Lix session.
186
193
  *
187
194
  * This is not SQLite SQL. Use the DataFusion SQL dialect; positional
188
- * placeholders are `$1`, `$2`, and so on. SQLite-specific catalog tables and
195
+ * placeholders are `?` or `$1`, `$2`, and so on. SQLite-specific catalog tables and
189
196
  * transaction statements such as `sqlite_master`, `BEGIN`, and `COMMIT` are
190
- * not available. Use `information_schema` for catalog inspection.
197
+ * not available. Use `information_schema` for catalog inspection. While a
198
+ * transaction is active, call `execute()` on the transaction handle instead.
191
199
  */
192
200
  execute(sql: string, params?: ReadonlyArray<LixRuntimeValue>): Promise<ExecuteResult>;
193
- activeVersionId(): Promise<string>;
194
- createVersion(options: CreateVersionOptions): Promise<CreateVersionResult>;
195
- switchVersion(options: SwitchVersionOptions): Promise<SwitchVersionResult>;
196
- mergeVersionPreview(options: MergeVersionOptions): Promise<MergeVersionPreviewResult>;
197
- mergeVersion(options: MergeVersionOptions): Promise<MergeVersionResult>;
201
+ beginTransaction(): Promise<LixTransaction>;
202
+ activeBranchId(): Promise<string>;
203
+ createBranch(options: CreateBranchOptions): Promise<CreateBranchResult>;
204
+ switchBranch(options: SwitchBranchOptions): Promise<SwitchBranchResult>;
205
+ mergeBranchPreview(options: MergeBranchOptions): Promise<MergeBranchPreviewResult>;
206
+ mergeBranch(options: MergeBranchOptions): Promise<MergeBranchResult>;
198
207
  close(): Promise<void>;
199
208
  };
209
+ export type LixTransaction = {
210
+ execute(sql: string, params?: ReadonlyArray<LixRuntimeValue>): Promise<ExecuteResult>;
211
+ commit(): Promise<void>;
212
+ rollback(): Promise<void>;
213
+ };
200
214
  export declare function openLix(options?: OpenLixOptions): Promise<Lix>;