lora-python 0.6.0__tar.gz → 0.8.0__tar.gz

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 (266) hide show
  1. {lora_python-0.6.0 → lora_python-0.8.0}/Cargo.lock +39 -15
  2. {lora_python-0.6.0 → lora_python-0.8.0}/Cargo.toml +13 -11
  3. {lora_python-0.6.0 → lora_python-0.8.0}/PKG-INFO +36 -5
  4. {lora_python-0.6.0 → lora_python-0.8.0}/README.md +35 -4
  5. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/README.md +35 -4
  6. lora_python-0.8.0/crates/bindings/lora-python/src/errors.rs +73 -0
  7. lora_python-0.8.0/crates/bindings/lora-python/src/from_python.rs +503 -0
  8. lora_python-0.8.0/crates/bindings/lora-python/src/lib.rs +595 -0
  9. lora_python-0.8.0/crates/bindings/lora-python/src/to_python.rs +280 -0
  10. lora_python-0.8.0/crates/bindings/lora-python/tests/test_explain_profile.py +78 -0
  11. lora_python-0.8.0/crates/lora-analyzer/src/analyzer/clauses.rs +323 -0
  12. lora_python-0.8.0/crates/lora-analyzer/src/analyzer/expressions.rs +604 -0
  13. lora_python-0.8.0/crates/lora-analyzer/src/analyzer/mod.rs +34 -0
  14. lora_python-0.8.0/crates/lora-analyzer/src/analyzer/patterns.rs +244 -0
  15. lora_python-0.8.0/crates/lora-analyzer/src/analyzer/state.rs +309 -0
  16. lora_python-0.8.0/crates/lora-analyzer/src/analyzer/tests.rs +302 -0
  17. lora_python-0.8.0/crates/lora-analyzer/src/errors.rs +58 -0
  18. lora_python-0.8.0/crates/lora-analyzer/src/lib.rs +15 -0
  19. lora_python-0.8.0/crates/lora-analyzer/tests/error_messages.rs +136 -0
  20. lora_python-0.8.0/crates/lora-ast/src/lib.rs +18 -0
  21. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-compiler/src/lib.rs +14 -2
  22. lora_python-0.8.0/crates/lora-compiler/src/plan_tree.rs +303 -0
  23. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/Cargo.toml +7 -0
  24. lora_python-0.8.0/crates/lora-database/benches/concurrent_benchmarks.rs +347 -0
  25. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/engine_benchmarks.rs +11 -0
  26. lora_python-0.8.0/crates/lora-database/src/database/builder.rs +254 -0
  27. lora_python-0.8.0/crates/lora-database/src/database/compile.rs +53 -0
  28. lora_python-0.8.0/crates/lora-database/src/database/execute.rs +194 -0
  29. lora_python-0.8.0/crates/lora-database/src/database/explain.rs +57 -0
  30. lora_python-0.8.0/crates/lora-database/src/database/graph_api.rs +346 -0
  31. lora_python-0.8.0/crates/lora-database/src/database/mod.rs +275 -0
  32. lora_python-0.8.0/crates/lora-database/src/database/occ.rs +184 -0
  33. lora_python-0.8.0/crates/lora-database/src/database/profile.rs +121 -0
  34. lora_python-0.8.0/crates/lora-database/src/database/pull_mode.rs +49 -0
  35. lora_python-0.8.0/crates/lora-database/src/database/replay.rs +303 -0
  36. lora_python-0.8.0/crates/lora-database/src/database/stream.rs +166 -0
  37. lora_python-0.8.0/crates/lora-database/src/database/write_guard.rs +216 -0
  38. lora_python-0.8.0/crates/lora-database/src/error.rs +497 -0
  39. lora_python-0.8.0/crates/lora-database/src/explain.rs +97 -0
  40. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/src/lib.rs +15 -9
  41. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/src/named.rs +3 -3
  42. lora_python-0.8.0/crates/lora-database/src/plan_cache.rs +225 -0
  43. lora_python-0.8.0/crates/lora-database/src/snapshot/json.rs +305 -0
  44. lora_python-0.8.0/crates/lora-database/src/snapshot/mod.rs +418 -0
  45. lora_python-0.6.0/crates/lora-database/src/snapshot_store.rs → lora_python-0.8.0/crates/lora-database/src/snapshot/store.rs +22 -8
  46. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/src/stream.rs +61 -74
  47. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/src/transaction.rs +394 -195
  48. lora_python-0.8.0/crates/lora-database/src/wal/admin.rs +77 -0
  49. lora_python-0.8.0/crates/lora-database/src/wal/archive/format.rs +151 -0
  50. lora_python-0.8.0/crates/lora-database/src/wal/archive/lock.rs +208 -0
  51. lora_python-0.8.0/crates/lora-database/src/wal/archive/platform.rs +49 -0
  52. lora_python-0.8.0/crates/lora-database/src/wal/archive/worker.rs +47 -0
  53. lora_python-0.8.0/crates/lora-database/src/wal/archive/workspace.rs +210 -0
  54. lora_python-0.8.0/crates/lora-database/src/wal/archive.rs +182 -0
  55. lora_python-0.8.0/crates/lora-database/src/wal/mod.rs +9 -0
  56. lora_python-0.8.0/crates/lora-database/src/wal/write_scope.rs +76 -0
  57. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/backend_stub.rs +1 -1
  58. lora_python-0.8.0/crates/lora-database/tests/error_messages.rs +38 -0
  59. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/errors.rs +17 -17
  60. lora_python-0.8.0/crates/lora-database/tests/explain_profile.rs +231 -0
  61. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/functions_extended.rs +12 -0
  62. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/invariants.rs +1 -1
  63. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/managed_snapshots.rs +82 -1
  64. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/match.rs +1 -1
  65. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/paths.rs +1 -1
  66. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/projection.rs +1 -1
  67. lora_python-0.8.0/crates/lora-database/tests/scale.rs +241 -0
  68. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/snapshot.rs +1 -20
  69. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/test_helpers.rs +4 -4
  70. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/transactions.rs +178 -36
  71. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/update.rs +1 -1
  72. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/vectors.rs +22 -9
  73. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/wal.rs +30 -11
  74. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/with.rs +5 -5
  75. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-executor/Cargo.toml +1 -0
  76. lora_python-0.8.0/crates/lora-executor/src/eval/binops.rs +325 -0
  77. lora_python-0.8.0/crates/lora-executor/src/eval/errors.rs +31 -0
  78. lora_python-0.8.0/crates/lora-executor/src/eval/expr.rs +747 -0
  79. lora_python-0.8.0/crates/lora-executor/src/eval/functions.rs +885 -0
  80. lora_python-0.8.0/crates/lora-executor/src/eval/mod.rs +35 -0
  81. lora_python-0.8.0/crates/lora-executor/src/eval/point.rs +200 -0
  82. lora_python-0.8.0/crates/lora-executor/src/eval/vector.rs +310 -0
  83. lora_python-0.8.0/crates/lora-executor/src/executor/helpers.rs +987 -0
  84. lora_python-0.8.0/crates/lora-executor/src/executor/immutable.rs +946 -0
  85. lora_python-0.8.0/crates/lora-executor/src/executor/mod.rs +56 -0
  86. lora_python-0.6.0/crates/lora-executor/src/executor.rs → lora_python-0.8.0/crates/lora-executor/src/executor/mutable.rs +1069 -2703
  87. lora_python-0.8.0/crates/lora-executor/src/lib.rs +22 -0
  88. lora_python-0.8.0/crates/lora-executor/src/profile.rs +126 -0
  89. lora_python-0.8.0/crates/lora-executor/src/pull/aggregate.rs +444 -0
  90. lora_python-0.8.0/crates/lora-executor/src/pull/columns.rs +50 -0
  91. lora_python-0.8.0/crates/lora-executor/src/pull/context.rs +33 -0
  92. lora_python-0.8.0/crates/lora-executor/src/pull/expand.rs +449 -0
  93. lora_python-0.8.0/crates/lora-executor/src/pull/filter.rs +49 -0
  94. lora_python-0.8.0/crates/lora-executor/src/pull/hydration.rs +59 -0
  95. lora_python-0.8.0/crates/lora-executor/src/pull/mod.rs +103 -0
  96. lora_python-0.8.0/crates/lora-executor/src/pull/mutable.rs +298 -0
  97. lora_python-0.8.0/crates/lora-executor/src/pull/optional.rs +125 -0
  98. lora_python-0.8.0/crates/lora-executor/src/pull/path.rs +148 -0
  99. lora_python-0.8.0/crates/lora-executor/src/pull/projection.rs +185 -0
  100. lora_python-0.8.0/crates/lora-executor/src/pull/scan.rs +361 -0
  101. lora_python-0.8.0/crates/lora-executor/src/pull/shape.rs +50 -0
  102. lora_python-0.8.0/crates/lora-executor/src/pull/sort.rs +142 -0
  103. lora_python-0.8.0/crates/lora-executor/src/pull/source.rs +72 -0
  104. lora_python-0.8.0/crates/lora-executor/src/pull/tests.rs +72 -0
  105. lora_python-0.8.0/crates/lora-executor/src/pull/traits.rs +444 -0
  106. lora_python-0.8.0/crates/lora-executor/src/pull/union.rs +62 -0
  107. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-executor/src/value.rs +89 -39
  108. lora_python-0.8.0/crates/lora-executor/tests/error_messages.rs +251 -0
  109. lora_python-0.6.0/crates/lora-parser/src/error.rs → lora_python-0.8.0/crates/lora-parser/src/errors.rs +1 -1
  110. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-parser/src/lib.rs +2 -2
  111. lora_python-0.8.0/crates/lora-parser/src/parser/clauses.rs +578 -0
  112. lora_python-0.8.0/crates/lora-parser/src/parser/expressions.rs +602 -0
  113. lora_python-0.8.0/crates/lora-parser/src/parser/literals.rs +476 -0
  114. lora_python-0.8.0/crates/lora-parser/src/parser/mod.rs +82 -0
  115. lora_python-0.8.0/crates/lora-parser/src/parser/patterns.rs +294 -0
  116. lora_python-0.8.0/crates/lora-parser/src/parser/query.rs +141 -0
  117. lora_python-0.8.0/crates/lora-parser/src/parser/tests.rs +1390 -0
  118. lora_python-0.8.0/crates/lora-parser/src/parser/util.rs +30 -0
  119. lora_python-0.8.0/crates/lora-parser/tests/error_messages.rs +24 -0
  120. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/src/body.rs +12 -6
  121. lora_python-0.6.0/crates/lora-snapshot/src/lib.rs → lora_python-0.8.0/crates/lora-snapshot/src/codec.rs +14 -36
  122. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/src/columnar.rs +2 -2
  123. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/src/envelope.rs +18 -6
  124. lora_python-0.6.0/crates/lora-snapshot/src/error.rs → lora_python-0.8.0/crates/lora-snapshot/src/errors.rs +1 -1
  125. lora_python-0.8.0/crates/lora-snapshot/src/format.rs +7 -0
  126. lora_python-0.8.0/crates/lora-snapshot/src/lib.rs +45 -0
  127. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/src/tests.rs +19 -0
  128. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/src/transform.rs +2 -2
  129. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/src/view.rs +12 -9
  130. lora_python-0.8.0/crates/lora-snapshot/tests/error_messages.rs +99 -0
  131. lora_python-0.8.0/crates/lora-store/src/lib.rs +45 -0
  132. lora_python-0.8.0/crates/lora-store/src/lock_table.rs +233 -0
  133. lora_python-0.8.0/crates/lora-store/src/memory/graph.rs +1291 -0
  134. lora_python-0.8.0/crates/lora-store/src/memory/impls.rs +844 -0
  135. lora_python-0.8.0/crates/lora-store/src/memory/mod.rs +23 -0
  136. lora_python-0.8.0/crates/lora-store/src/memory/property_index.rs +265 -0
  137. lora_python-0.8.0/crates/lora-store/src/memory/snapshot.rs +78 -0
  138. lora_python-0.8.0/crates/lora-store/src/memory/tests.rs +820 -0
  139. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-store/src/mutation.rs +119 -0
  140. lora_python-0.8.0/crates/lora-store/src/snapshot.rs +67 -0
  141. lora_python-0.6.0/crates/lora-store/src/graph.rs → lora_python-0.8.0/crates/lora-store/src/traits.rs +12 -87
  142. lora_python-0.8.0/crates/lora-store/src/types/binary/mod.rs +17 -0
  143. lora_python-0.8.0/crates/lora-store/src/types/binary/tests.rs +19 -0
  144. lora_python-0.8.0/crates/lora-store/src/types/binary/traits.rs +37 -0
  145. lora_python-0.6.0/crates/lora-store/src/binary.rs → lora_python-0.8.0/crates/lora-store/src/types/binary/types.rs +3 -55
  146. lora_python-0.8.0/crates/lora-store/src/types/graph.rs +70 -0
  147. lora_python-0.8.0/crates/lora-store/src/types/mod.rs +44 -0
  148. lora_python-0.8.0/crates/lora-store/src/types/property_value.rs +39 -0
  149. lora_python-0.8.0/crates/lora-store/src/types/spatial/distance.rs +51 -0
  150. lora_python-0.8.0/crates/lora-store/src/types/spatial/mod.rs +24 -0
  151. lora_python-0.8.0/crates/lora-store/src/types/spatial/point.rs +149 -0
  152. lora_python-0.8.0/crates/lora-store/src/types/spatial/srid.rs +146 -0
  153. lora_python-0.8.0/crates/lora-store/src/types/spatial/tests.rs +93 -0
  154. lora_python-0.8.0/crates/lora-store/src/types/temporal/calendar.rs +88 -0
  155. lora_python-0.8.0/crates/lora-store/src/types/temporal/date.rs +121 -0
  156. lora_python-0.8.0/crates/lora-store/src/types/temporal/datetime.rs +251 -0
  157. lora_python-0.8.0/crates/lora-store/src/types/temporal/duration.rs +316 -0
  158. lora_python-0.8.0/crates/lora-store/src/types/temporal/format.rs +29 -0
  159. lora_python-0.8.0/crates/lora-store/src/types/temporal/mod.rs +28 -0
  160. lora_python-0.8.0/crates/lora-store/src/types/temporal/parsing.rs +90 -0
  161. lora_python-0.8.0/crates/lora-store/src/types/temporal/time.rs +121 -0
  162. lora_python-0.8.0/crates/lora-store/src/types/vector/build.rs +242 -0
  163. lora_python-0.8.0/crates/lora-store/src/types/vector/mod.rs +36 -0
  164. lora_python-0.8.0/crates/lora-store/src/types/vector/similarity.rs +157 -0
  165. lora_python-0.8.0/crates/lora-store/src/types/vector/tests.rs +620 -0
  166. lora_python-0.8.0/crates/lora-store/src/types/vector/types.rs +211 -0
  167. lora_python-0.8.0/crates/lora-store/tests/error_messages.rs +98 -0
  168. lora_python-0.8.0/crates/lora-wal/src/codec/decode.rs +369 -0
  169. lora_python-0.8.0/crates/lora-wal/src/codec/encode.rs +546 -0
  170. lora_python-0.8.0/crates/lora-wal/src/codec/format.rs +40 -0
  171. lora_python-0.8.0/crates/lora-wal/src/codec/mod.rs +26 -0
  172. lora_python-0.8.0/crates/lora-wal/src/codec/tests.rs +193 -0
  173. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/dir.rs +1 -1
  174. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/lib.rs +6 -4
  175. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/lock.rs +1 -1
  176. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/record.rs +2 -2
  177. lora_python-0.8.0/crates/lora-wal/src/recorder/errors.rs +59 -0
  178. lora_python-0.8.0/crates/lora-wal/src/recorder/mirror.rs +19 -0
  179. lora_python-0.8.0/crates/lora-wal/src/recorder/mod.rs +20 -0
  180. lora_python-0.6.0/crates/lora-wal/src/recorder_adapter.rs → lora_python-0.8.0/crates/lora-wal/src/recorder/recorder.rs +75 -222
  181. lora_python-0.8.0/crates/lora-wal/src/recorder/tests.rs +196 -0
  182. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/replay.rs +1 -1
  183. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/segment.rs +1 -1
  184. lora_python-0.8.0/crates/lora-wal/src/wal/group_flusher.rs +81 -0
  185. lora_python-0.8.0/crates/lora-wal/src/wal/mod.rs +18 -0
  186. lora_python-0.8.0/crates/lora-wal/src/wal/tests.rs +443 -0
  187. {lora_python-0.6.0/crates/lora-wal/src → lora_python-0.8.0/crates/lora-wal/src/wal}/wal.rs +16 -526
  188. lora_python-0.8.0/crates/lora-wal/tests/error_messages.rs +155 -0
  189. {lora_python-0.6.0 → lora_python-0.8.0}/pyproject.toml +2 -2
  190. lora_python-0.6.0/crates/lora-analyzer/src/analyzer.rs +0 -1862
  191. lora_python-0.6.0/crates/lora-analyzer/src/errors.rs +0 -58
  192. lora_python-0.6.0/crates/lora-analyzer/src/lib.rs +0 -9
  193. lora_python-0.6.0/crates/lora-ast/src/lib.rs +0 -9
  194. lora_python-0.6.0/crates/lora-database/src/archive.rs +0 -803
  195. lora_python-0.6.0/crates/lora-database/src/database.rs +0 -1958
  196. lora_python-0.6.0/crates/lora-executor/src/eval.rs +0 -2386
  197. lora_python-0.6.0/crates/lora-executor/src/lib.rs +0 -13
  198. lora_python-0.6.0/crates/lora-executor/src/pull.rs +0 -2500
  199. lora_python-0.6.0/crates/lora-parser/src/parser.rs +0 -3499
  200. lora_python-0.6.0/crates/lora-python/src/lib.rs +0 -1225
  201. lora_python-0.6.0/crates/lora-store/src/lib.rs +0 -20
  202. lora_python-0.6.0/crates/lora-store/src/memory.rs +0 -2758
  203. lora_python-0.6.0/crates/lora-store/src/snapshot.rs +0 -458
  204. lora_python-0.6.0/crates/lora-store/src/spatial.rs +0 -435
  205. lora_python-0.6.0/crates/lora-store/src/temporal.rs +0 -983
  206. lora_python-0.6.0/crates/lora-store/src/vector.rs +0 -1242
  207. lora_python-0.6.0/crates/lora-wal/src/codec.rs +0 -1139
  208. {lora_python-0.6.0 → lora_python-0.8.0}/LICENSE +0 -0
  209. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/.gitignore +0 -0
  210. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/Cargo.toml +0 -0
  211. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/LICENSE +0 -0
  212. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/build.rs +0 -0
  213. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/examples/async_demo.py +0 -0
  214. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/examples/basic.py +0 -0
  215. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/tests/test_async.py +0 -0
  216. {lora_python-0.6.0/crates → lora_python-0.8.0/crates/bindings}/lora-python/tests/test_sync.py +0 -0
  217. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-analyzer/Cargo.toml +0 -0
  218. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-analyzer/src/resolved.rs +0 -0
  219. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-analyzer/src/scope.rs +0 -0
  220. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-analyzer/src/symbols.rs +0 -0
  221. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-ast/Cargo.toml +0 -0
  222. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-ast/src/ast.rs +0 -0
  223. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-compiler/Cargo.toml +0 -0
  224. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-compiler/src/logical.rs +0 -0
  225. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-compiler/src/optimizer.rs +0 -0
  226. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-compiler/src/pattern.rs +0 -0
  227. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-compiler/src/physical.rs +0 -0
  228. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-compiler/src/planner.rs +0 -0
  229. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/advanced_benchmarks.rs +0 -0
  230. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/fixtures.rs +0 -0
  231. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/perf_smoke_baseline.json +0 -0
  232. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/perf_smoke_benchmarks.rs +0 -0
  233. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/scale_benchmarks.rs +0 -0
  234. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/temporal_spatial_benchmarks.rs +0 -0
  235. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/benches/wal_benchmarks.rs +0 -0
  236. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/advanced_queries.rs +0 -0
  237. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/aggregation.rs +0 -0
  238. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/binary.rs +0 -0
  239. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/create.rs +0 -0
  240. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/expressions.rs +0 -0
  241. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/merge.rs +0 -0
  242. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/ordering.rs +0 -0
  243. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/parameters.rs +0 -0
  244. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/parser.rs +0 -0
  245. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/seeds.rs +0 -0
  246. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/spatial.rs +0 -0
  247. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/temporal.rs +0 -0
  248. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/types_advanced.rs +0 -0
  249. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/union.rs +0 -0
  250. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-database/tests/where_clause.rs +0 -0
  251. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-executor/src/errors.rs +0 -0
  252. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-parser/Cargo.toml +0 -0
  253. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-parser/src/cypher.pest +0 -0
  254. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/Cargo.toml +0 -0
  255. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-snapshot/src/options.rs +0 -0
  256. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-store/Cargo.toml +0 -0
  257. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/Cargo.toml +0 -0
  258. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/config.rs +0 -0
  259. /lora_python-0.6.0/crates/lora-wal/src/error.rs → /lora_python-0.8.0/crates/lora-wal/src/errors.rs +0 -0
  260. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/lsn.rs +0 -0
  261. {lora_python-0.6.0 → lora_python-0.8.0}/crates/lora-wal/src/testing.rs +0 -0
  262. {lora_python-0.6.0 → lora_python-0.8.0}/python/lora_python/__init__.py +0 -0
  263. {lora_python-0.6.0 → lora_python-0.8.0}/python/lora_python/_async.py +0 -0
  264. {lora_python-0.6.0 → lora_python-0.8.0}/python/lora_python/_native.pyi +0 -0
  265. {lora_python-0.6.0 → lora_python-0.8.0}/python/lora_python/py.typed +0 -0
  266. {lora_python-0.6.0 → lora_python-0.8.0}/python/lora_python/types.py +0 -0
@@ -54,6 +54,15 @@ version = "1.0.102"
54
54
  source = "registry+https://github.com/rust-lang/crates.io-index"
55
55
  checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
56
56
 
57
+ [[package]]
58
+ name = "arc-swap"
59
+ version = "1.9.1"
60
+ source = "registry+https://github.com/rust-lang/crates.io-index"
61
+ checksum = "6a3a1fd6f75306b68087b831f025c712524bcb19aad54e557b1129cfa0a2b207"
62
+ dependencies = [
63
+ "rustversion",
64
+ ]
65
+
57
66
  [[package]]
58
67
  name = "argon2"
59
68
  version = "0.5.3"
@@ -788,7 +797,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
788
797
 
789
798
  [[package]]
790
799
  name = "lora-analyzer"
791
- version = "0.6.0"
800
+ version = "0.8.0"
792
801
  dependencies = [
793
802
  "lora-ast",
794
803
  "lora-parser",
@@ -798,14 +807,22 @@ dependencies = [
798
807
 
799
808
  [[package]]
800
809
  name = "lora-ast"
801
- version = "0.6.0"
810
+ version = "0.8.0"
802
811
  dependencies = [
803
812
  "smallvec 2.0.0-alpha.12",
804
813
  ]
805
814
 
815
+ [[package]]
816
+ name = "lora-binding-buffer"
817
+ version = "0.8.0"
818
+ dependencies = [
819
+ "lora-database",
820
+ "lora-store",
821
+ ]
822
+
806
823
  [[package]]
807
824
  name = "lora-compiler"
808
- version = "0.6.0"
825
+ version = "0.8.0"
809
826
  dependencies = [
810
827
  "lora-analyzer",
811
828
  "lora-ast",
@@ -813,9 +830,10 @@ dependencies = [
813
830
 
814
831
  [[package]]
815
832
  name = "lora-database"
816
- version = "0.6.0"
833
+ version = "0.8.0"
817
834
  dependencies = [
818
835
  "anyhow",
836
+ "arc-swap",
819
837
  "criterion",
820
838
  "lora-analyzer",
821
839
  "lora-ast",
@@ -826,13 +844,15 @@ dependencies = [
826
844
  "lora-store",
827
845
  "lora-wal",
828
846
  "serde_json",
847
+ "thiserror",
829
848
  "tower",
849
+ "tracing",
830
850
  "zip",
831
851
  ]
832
852
 
833
853
  [[package]]
834
854
  name = "lora-executor"
835
- version = "0.6.0"
855
+ version = "0.8.0"
836
856
  dependencies = [
837
857
  "lora-analyzer",
838
858
  "lora-ast",
@@ -840,15 +860,17 @@ dependencies = [
840
860
  "lora-store",
841
861
  "regex",
842
862
  "serde",
863
+ "smallvec 2.0.0-alpha.12",
843
864
  "thiserror",
844
865
  "tracing",
845
866
  ]
846
867
 
847
868
  [[package]]
848
869
  name = "lora-ffi"
849
- version = "0.6.0"
870
+ version = "0.8.0"
850
871
  dependencies = [
851
872
  "anyhow",
873
+ "lora-binding-buffer",
852
874
  "lora-database",
853
875
  "lora-store",
854
876
  "serde",
@@ -857,9 +879,10 @@ dependencies = [
857
879
 
858
880
  [[package]]
859
881
  name = "lora-node"
860
- version = "0.6.0"
882
+ version = "0.8.0"
861
883
  dependencies = [
862
884
  "anyhow",
885
+ "lora-binding-buffer",
863
886
  "lora-database",
864
887
  "lora-store",
865
888
  "napi",
@@ -871,7 +894,7 @@ dependencies = [
871
894
 
872
895
  [[package]]
873
896
  name = "lora-parser"
874
- version = "0.6.0"
897
+ version = "0.8.0"
875
898
  dependencies = [
876
899
  "lora-ast",
877
900
  "pest",
@@ -882,7 +905,7 @@ dependencies = [
882
905
 
883
906
  [[package]]
884
907
  name = "lora-python"
885
- version = "0.6.0"
908
+ version = "0.8.0"
886
909
  dependencies = [
887
910
  "anyhow",
888
911
  "lora-database",
@@ -894,7 +917,7 @@ dependencies = [
894
917
 
895
918
  [[package]]
896
919
  name = "lora-server"
897
- version = "0.6.0"
920
+ version = "0.8.0"
898
921
  dependencies = [
899
922
  "anyhow",
900
923
  "axum",
@@ -908,7 +931,7 @@ dependencies = [
908
931
 
909
932
  [[package]]
910
933
  name = "lora-snapshot"
911
- version = "0.6.0"
934
+ version = "0.8.0"
912
935
  dependencies = [
913
936
  "argon2",
914
937
  "bincode",
@@ -923,7 +946,7 @@ dependencies = [
923
946
 
924
947
  [[package]]
925
948
  name = "lora-store"
926
- version = "0.6.0"
949
+ version = "0.8.0"
927
950
  dependencies = [
928
951
  "bincode",
929
952
  "crc32fast",
@@ -935,7 +958,7 @@ dependencies = [
935
958
 
936
959
  [[package]]
937
960
  name = "lora-wal"
938
- version = "0.6.0"
961
+ version = "0.8.0"
939
962
  dependencies = [
940
963
  "crc32fast",
941
964
  "lora-store",
@@ -945,11 +968,12 @@ dependencies = [
945
968
 
946
969
  [[package]]
947
970
  name = "lora-wasm"
948
- version = "0.6.0"
971
+ version = "0.8.0"
949
972
  dependencies = [
950
973
  "anyhow",
951
974
  "console_error_panic_hook",
952
975
  "js-sys",
976
+ "lora-binding-buffer",
953
977
  "lora-database",
954
978
  "lora-store",
955
979
  "serde",
@@ -960,7 +984,7 @@ dependencies = [
960
984
 
961
985
  [[package]]
962
986
  name = "lora_ruby"
963
- version = "0.6.0"
987
+ version = "0.8.0"
964
988
  dependencies = [
965
989
  "anyhow",
966
990
  "lora-database",
@@ -1,10 +1,10 @@
1
1
  [workspace]
2
- members = ["crates/lora-ast", "crates/lora-parser", "crates/lora-analyzer", "crates/lora-compiler", "crates/lora-store", "crates/lora-snapshot", "crates/lora-wal", "crates/lora-executor", "crates/lora-database", "crates/lora-python"]
2
+ members = ["crates/lora-ast", "crates/lora-parser", "crates/lora-analyzer", "crates/lora-compiler", "crates/lora-store", "crates/lora-snapshot", "crates/lora-wal", "crates/lora-executor", "crates/lora-database", "crates/bindings/lora-python"]
3
3
  resolver = "2"
4
4
 
5
5
  [workspace.package]
6
6
  edition = "2021"
7
- version = "0.6.0"
7
+ version = "0.8.0"
8
8
  license = "BUSL-1.1"
9
9
  authors = ["LoraDB, Inc."]
10
10
  repository = "https://github.com/lora-db/lora"
@@ -15,18 +15,20 @@ rust-version = "1.87"
15
15
  # Internal crates — versions are kept in lockstep with [workspace.package].version
16
16
  # by `scripts/sync-versions.mjs`. Both `path` and `version` are set so that
17
17
  # `cargo publish` works (crates.io cannot resolve path-only deps).
18
- lora-ast = { path = "crates/lora-ast", version = "=0.6.0" }
19
- lora-parser = { path = "crates/lora-parser", version = "=0.6.0" }
20
- lora-analyzer = { path = "crates/lora-analyzer", version = "=0.6.0" }
21
- lora-compiler = { path = "crates/lora-compiler", version = "=0.6.0" }
22
- lora-store = { path = "crates/lora-store", version = "=0.6.0" }
23
- lora-snapshot = { path = "crates/lora-snapshot", version = "=0.6.0", default-features = false }
24
- lora-wal = { path = "crates/lora-wal", version = "=0.6.0" }
25
- lora-executor = { path = "crates/lora-executor", version = "=0.6.0" }
26
- lora-database = { path = "crates/lora-database", version = "=0.6.0" }
18
+ lora-ast = { path = "crates/lora-ast", version = "=0.8.0" }
19
+ lora-parser = { path = "crates/lora-parser", version = "=0.8.0" }
20
+ lora-analyzer = { path = "crates/lora-analyzer", version = "=0.8.0" }
21
+ lora-compiler = { path = "crates/lora-compiler", version = "=0.8.0" }
22
+ lora-store = { path = "crates/lora-store", version = "=0.8.0" }
23
+ lora-snapshot = { path = "crates/lora-snapshot", version = "=0.8.0", default-features = false }
24
+ lora-wal = { path = "crates/lora-wal", version = "=0.8.0" }
25
+ lora-executor = { path = "crates/lora-executor", version = "=0.8.0" }
26
+ lora-database = { path = "crates/lora-database", version = "=0.8.0" }
27
+ lora-binding-buffer = { path = "crates/bindings/lora-binding-buffer", version = "=0.8.0" }
27
28
 
28
29
  # External crates.
29
30
  anyhow = "1"
31
+ arc-swap = "1"
30
32
  thiserror = "2"
31
33
  tracing = "0"
32
34
  axum = "0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lora-python
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3.8
@@ -30,16 +30,16 @@ Project-URL: Repository, https://github.com/lora-db/lora
30
30
 
31
31
  # lora-python
32
32
 
33
- Python bindings for the [Lora](../../README.md) graph
33
+ Python bindings for the [Lora](../../../README.md) graph
34
34
  engine. Ships both a synchronous PyO3 `Database` class and an
35
35
  asyncio-compatible `AsyncDatabase` wrapper that never blocks the event loop.
36
36
 
37
- > **Status:** prototype / feasibility check. Not published to PyPI.
37
+ > **Package:** `lora-python`.
38
38
 
39
39
  ## Install (local dev)
40
40
 
41
41
  ```bash
42
- cd crates/lora-python
42
+ cd crates/bindings/lora-python
43
43
  python3 -m venv .venv && source .venv/bin/activate
44
44
  pip install -U pip maturin pytest pytest-asyncio
45
45
  maturin develop # builds the Rust extension into the venv
@@ -76,6 +76,37 @@ persistent = Database.create("app", {"database_dir": "./data"}) # persistent: .
76
76
  If you want persistence, pass a database name and `database_dir` to
77
77
  `Database.create(...)` or `Database(...)`.
78
78
 
79
+ ## Explain & Profile
80
+
81
+ `db.explain()` and `db.profile()` are first-class methods alongside
82
+ `db.execute()`. They are intentionally separate calls — neither
83
+ routes through `execute()` — so plan inspection and runtime metrics
84
+ must be requested explicitly.
85
+
86
+ ```python
87
+ plan = db.explain(
88
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
89
+ {"name": "Alice"},
90
+ )
91
+ print(plan["shape"]) # "readOnly"
92
+ print(plan["tree"]["operator"]) # top-most operator label
93
+
94
+ profile = db.profile(
95
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
96
+ {"name": "Alice"},
97
+ )
98
+ print(profile["metrics"]["total_elapsed_ns"])
99
+ print(profile["metrics"]["per_operator"]) # per-step inclusive timing
100
+ ```
101
+
102
+ `explain()` never invokes the executor — calling it on a mutating
103
+ query (`CREATE`, `MERGE`, `SET`, `DELETE`, `REMOVE`) leaves the graph
104
+ untouched.
105
+
106
+ > **`profile()` executes the query for real.** Mutating queries
107
+ > produce the same side effects as `execute()`. Use `explain()` to
108
+ > inspect a mutating plan without running it.
109
+
79
110
  ## Async usage (non-blocking)
80
111
 
81
112
  ```python
@@ -133,7 +164,7 @@ Constructors and guards are exported from `lora_python.types`:
133
164
  `is_relationship`, `is_path`, `is_point`, `is_temporal`.
134
165
 
135
166
  > `distance()` on WGS-84-3D points ignores `height` — see
136
- > [functions reference](../../apps/loradb.com/docs/functions/overview.md) for the full spatial
167
+ > [functions reference](../../../apps/loradb.com/docs/functions/overview.md) for the full spatial
137
168
  > reference and known limitations.
138
169
 
139
170
  ## Errors
@@ -1,15 +1,15 @@
1
1
  # lora-python
2
2
 
3
- Python bindings for the [Lora](../../README.md) graph
3
+ Python bindings for the [Lora](../../../README.md) graph
4
4
  engine. Ships both a synchronous PyO3 `Database` class and an
5
5
  asyncio-compatible `AsyncDatabase` wrapper that never blocks the event loop.
6
6
 
7
- > **Status:** prototype / feasibility check. Not published to PyPI.
7
+ > **Package:** `lora-python`.
8
8
 
9
9
  ## Install (local dev)
10
10
 
11
11
  ```bash
12
- cd crates/lora-python
12
+ cd crates/bindings/lora-python
13
13
  python3 -m venv .venv && source .venv/bin/activate
14
14
  pip install -U pip maturin pytest pytest-asyncio
15
15
  maturin develop # builds the Rust extension into the venv
@@ -46,6 +46,37 @@ persistent = Database.create("app", {"database_dir": "./data"}) # persistent: .
46
46
  If you want persistence, pass a database name and `database_dir` to
47
47
  `Database.create(...)` or `Database(...)`.
48
48
 
49
+ ## Explain & Profile
50
+
51
+ `db.explain()` and `db.profile()` are first-class methods alongside
52
+ `db.execute()`. They are intentionally separate calls — neither
53
+ routes through `execute()` — so plan inspection and runtime metrics
54
+ must be requested explicitly.
55
+
56
+ ```python
57
+ plan = db.explain(
58
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
59
+ {"name": "Alice"},
60
+ )
61
+ print(plan["shape"]) # "readOnly"
62
+ print(plan["tree"]["operator"]) # top-most operator label
63
+
64
+ profile = db.profile(
65
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
66
+ {"name": "Alice"},
67
+ )
68
+ print(profile["metrics"]["total_elapsed_ns"])
69
+ print(profile["metrics"]["per_operator"]) # per-step inclusive timing
70
+ ```
71
+
72
+ `explain()` never invokes the executor — calling it on a mutating
73
+ query (`CREATE`, `MERGE`, `SET`, `DELETE`, `REMOVE`) leaves the graph
74
+ untouched.
75
+
76
+ > **`profile()` executes the query for real.** Mutating queries
77
+ > produce the same side effects as `execute()`. Use `explain()` to
78
+ > inspect a mutating plan without running it.
79
+
49
80
  ## Async usage (non-blocking)
50
81
 
51
82
  ```python
@@ -103,7 +134,7 @@ Constructors and guards are exported from `lora_python.types`:
103
134
  `is_relationship`, `is_path`, `is_point`, `is_temporal`.
104
135
 
105
136
  > `distance()` on WGS-84-3D points ignores `height` — see
106
- > [functions reference](../../apps/loradb.com/docs/functions/overview.md) for the full spatial
137
+ > [functions reference](../../../apps/loradb.com/docs/functions/overview.md) for the full spatial
107
138
  > reference and known limitations.
108
139
 
109
140
  ## Errors
@@ -1,15 +1,15 @@
1
1
  # lora-python
2
2
 
3
- Python bindings for the [Lora](../../README.md) graph
3
+ Python bindings for the [Lora](../../../README.md) graph
4
4
  engine. Ships both a synchronous PyO3 `Database` class and an
5
5
  asyncio-compatible `AsyncDatabase` wrapper that never blocks the event loop.
6
6
 
7
- > **Status:** prototype / feasibility check. Not published to PyPI.
7
+ > **Package:** `lora-python`.
8
8
 
9
9
  ## Install (local dev)
10
10
 
11
11
  ```bash
12
- cd crates/lora-python
12
+ cd crates/bindings/lora-python
13
13
  python3 -m venv .venv && source .venv/bin/activate
14
14
  pip install -U pip maturin pytest pytest-asyncio
15
15
  maturin develop # builds the Rust extension into the venv
@@ -46,6 +46,37 @@ persistent = Database.create("app", {"database_dir": "./data"}) # persistent: .
46
46
  If you want persistence, pass a database name and `database_dir` to
47
47
  `Database.create(...)` or `Database(...)`.
48
48
 
49
+ ## Explain & Profile
50
+
51
+ `db.explain()` and `db.profile()` are first-class methods alongside
52
+ `db.execute()`. They are intentionally separate calls — neither
53
+ routes through `execute()` — so plan inspection and runtime metrics
54
+ must be requested explicitly.
55
+
56
+ ```python
57
+ plan = db.explain(
58
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
59
+ {"name": "Alice"},
60
+ )
61
+ print(plan["shape"]) # "readOnly"
62
+ print(plan["tree"]["operator"]) # top-most operator label
63
+
64
+ profile = db.profile(
65
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
66
+ {"name": "Alice"},
67
+ )
68
+ print(profile["metrics"]["total_elapsed_ns"])
69
+ print(profile["metrics"]["per_operator"]) # per-step inclusive timing
70
+ ```
71
+
72
+ `explain()` never invokes the executor — calling it on a mutating
73
+ query (`CREATE`, `MERGE`, `SET`, `DELETE`, `REMOVE`) leaves the graph
74
+ untouched.
75
+
76
+ > **`profile()` executes the query for real.** Mutating queries
77
+ > produce the same side effects as `execute()`. Use `explain()` to
78
+ > inspect a mutating plan without running it.
79
+
49
80
  ## Async usage (non-blocking)
50
81
 
51
82
  ```python
@@ -103,7 +134,7 @@ Constructors and guards are exported from `lora_python.types`:
103
134
  `is_relationship`, `is_path`, `is_point`, `is_temporal`.
104
135
 
105
136
  > `distance()` on WGS-84-3D points ignores `height` — see
106
- > [functions reference](../../apps/loradb.com/docs/functions/overview.md) for the full spatial
137
+ > [functions reference](../../../apps/loradb.com/docs/functions/overview.md) for the full spatial
107
138
  > reference and known limitations.
108
139
 
109
140
  ## Errors
@@ -0,0 +1,73 @@
1
+ //! Exception type registrations for the Python bindings.
2
+ //!
3
+ //! `pyo3::create_exception!` generates the per-class machinery
4
+ //! (`new_err`, `type_object`, `From<Self> for PyErr`, etc.). The types
5
+ //! are registered with the module by `lib.rs::_native` at import time so
6
+ //! Python callers see `lora_python.LoraError` and friends.
7
+ //!
8
+ //! Engine errors are surfaced with the message body prefixed by the
9
+ //! precise wire code from [`lora_database::LoraErrorCode`] (e.g.
10
+ //! `"LORA_PARSE: parse error at 0..5: ..."`). Callers who care about
11
+ //! routing past the exception class can split on the first colon to
12
+ //! recover the code.
13
+
14
+ use pyo3::create_exception;
15
+ use pyo3::exceptions::PyException;
16
+ use pyo3::PyErr;
17
+
18
+ use lora_database::{LoraError as EngineLoraError, LoraErrorCode};
19
+
20
+ create_exception!(
21
+ lora_python,
22
+ LoraError,
23
+ PyException,
24
+ "Base class for Lora engine errors. Exception messages start with a stable `LORA_*` code."
25
+ );
26
+ create_exception!(
27
+ lora_python,
28
+ LoraQueryError,
29
+ LoraError,
30
+ "Parse / analyze / execute / IO failure. Exception message starts with a precise `LORA_*` code."
31
+ );
32
+ create_exception!(
33
+ lora_python,
34
+ InvalidParamsError,
35
+ LoraError,
36
+ "A parameter value could not be mapped to a Lora value. Message starts with `LORA_INVALID_PARAMS:`."
37
+ );
38
+
39
+ /// Build a [`LoraQueryError`], prefixing the message with the precise
40
+ /// wire code so the Python caller can route past the exception class.
41
+ /// Accepts anything convertible into [`EngineLoraError`] — typed
42
+ /// engine errors and binding-internal `anyhow::Error` both flow through
43
+ /// the same path.
44
+ pub(crate) fn lora_query_err_from_anyhow(err: impl Into<EngineLoraError>) -> PyErr {
45
+ let lora = err.into();
46
+ LoraQueryError::new_err(format!("{}: {}", lora.code().as_str(), lora.message()))
47
+ }
48
+
49
+ /// Borrowed-by-reference variant for call sites that don't have an
50
+ /// owned error (e.g. closures that need to keep the original).
51
+ #[allow(dead_code)]
52
+ pub(crate) fn lora_query_err_from_anyhow_ref(err: &anyhow::Error) -> PyErr {
53
+ let lora = EngineLoraError::from_anyhow_ref(err);
54
+ LoraQueryError::new_err(format!("{}: {}", lora.code().as_str(), lora.message()))
55
+ }
56
+
57
+ /// Build a [`LoraQueryError`] for a binding-side message that doesn't
58
+ /// carry a downcastable error chain (e.g. `database is closed`,
59
+ /// `database lock poisoned`). Tagged with [`LoraErrorCode::Internal`].
60
+ #[allow(dead_code)]
61
+ pub(crate) fn lora_query_err_internal(message: &str) -> PyErr {
62
+ LoraQueryError::new_err(format!("{}: {message}", LoraErrorCode::Internal.as_str()))
63
+ }
64
+
65
+ /// Build an [`InvalidParamsError`] tagged with `LORA_INVALID_PARAMS`.
66
+ #[allow(dead_code)]
67
+ pub(crate) fn invalid_params_err(message: impl AsRef<str>) -> PyErr {
68
+ InvalidParamsError::new_err(format!(
69
+ "{}: {}",
70
+ LoraErrorCode::InvalidParams.as_str(),
71
+ message.as_ref()
72
+ ))
73
+ }