pyturso 0.3.0rc5__tar.gz → 0.3.0rc6__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.

Potentially problematic release.


This version of pyturso might be problematic. Click here for more details.

Files changed (194) hide show
  1. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/Cargo.lock +27 -27
  2. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/Cargo.toml +17 -17
  3. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/PKG-INFO +1 -1
  4. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/index_method/mod.rs +3 -1
  5. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/index_method/toy_vector_sparse_ivf.rs +13 -14
  6. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/lib.rs +1 -1
  7. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/btree.rs +3 -0
  8. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/pager.rs +3 -3
  9. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/wal.rs +2 -1
  10. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/display.rs +27 -0
  11. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/emitter.rs +35 -6
  12. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/expr.rs +68 -51
  13. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/group_by.rs +25 -0
  14. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/index.rs +117 -19
  15. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/insert.rs +13 -15
  16. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/main_loop.rs +63 -24
  17. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/mod.rs +217 -2
  18. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/plan.rs +67 -9
  19. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/select.rs +5 -19
  20. pyturso-0.3.0rc6/core/translate/subquery.rs +689 -0
  21. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/types.rs +10 -0
  22. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/util.rs +151 -1
  23. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/builder.rs +20 -0
  24. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/execute.rs +201 -13
  25. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/explain.rs +33 -4
  26. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/insn.rs +22 -0
  27. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/mod.rs +8 -4
  28. pyturso-0.3.0rc5/core/translate/subquery.rs +0 -560
  29. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/Cargo.toml +0 -0
  30. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/build.rs +0 -0
  31. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/example.py +0 -0
  32. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/requirements-dev.txt +0 -0
  33. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/requirements.txt +0 -0
  34. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/src/errors.rs +0 -0
  35. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/src/lib.rs +0 -0
  36. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/tests/__init__.py +0 -0
  37. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/tests/test_database.py +0 -0
  38. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/turso/__init__.py +0 -0
  39. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/bindings/python/turso/py.typed +0 -0
  40. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/Cargo.toml +0 -0
  41. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/assert.rs +0 -0
  42. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/benches/benchmark.rs +0 -0
  43. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/benches/json_benchmark.rs +0 -0
  44. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/benches/mvcc_benchmark.rs +0 -0
  45. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/benches/tpc_h_benchmark.rs +0 -0
  46. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/build.rs +0 -0
  47. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/error.rs +0 -0
  48. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/ext/dynamic.rs +0 -0
  49. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/ext/mod.rs +0 -0
  50. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/ext/vtab_xconnect.rs +0 -0
  51. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/fast_lock.rs +0 -0
  52. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/function.rs +0 -0
  53. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/functions/datetime.rs +0 -0
  54. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/functions/mod.rs +0 -0
  55. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/functions/printf.rs +0 -0
  56. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/functions/strftime.rs +0 -0
  57. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/aggregate_operator.rs +0 -0
  58. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/compiler.rs +0 -0
  59. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/cursor.rs +0 -0
  60. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/dbsp.rs +0 -0
  61. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/expr_compiler.rs +0 -0
  62. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/filter_operator.rs +0 -0
  63. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/input_operator.rs +0 -0
  64. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/join_operator.rs +0 -0
  65. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/merge_operator.rs +0 -0
  66. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/mod.rs +0 -0
  67. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/operator.rs +0 -0
  68. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/persistence.rs +0 -0
  69. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/project_operator.rs +0 -0
  70. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/incremental/view.rs +0 -0
  71. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/index_method/backing_btree.rs +0 -0
  72. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/info.rs +0 -0
  73. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/clock.rs +0 -0
  74. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/common.rs +0 -0
  75. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/completions.rs +0 -0
  76. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/generic.rs +0 -0
  77. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/io_uring.rs +0 -0
  78. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/memory.rs +0 -0
  79. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/mod.rs +0 -0
  80. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/unix.rs +0 -0
  81. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/vfs.rs +0 -0
  82. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/io/windows.rs +0 -0
  83. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/json/cache.rs +0 -0
  84. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/json/error.rs +0 -0
  85. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/json/jsonb.rs +0 -0
  86. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/json/mod.rs +0 -0
  87. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/json/ops.rs +0 -0
  88. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/json/path.rs +0 -0
  89. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/json/vtab.rs +0 -0
  90. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/clock.rs +0 -0
  91. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/cursor.rs +0 -0
  92. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/database/checkpoint_state_machine.rs +0 -0
  93. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/database/mod.rs +0 -0
  94. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/database/tests.rs +0 -0
  95. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/mod.rs +0 -0
  96. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/persistent_storage/logical_log.rs +0 -0
  97. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/mvcc/persistent_storage/mod.rs +0 -0
  98. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/numeric/mod.rs +0 -0
  99. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/numeric/nonnan.rs +0 -0
  100. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/parameters.rs +0 -0
  101. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/pragma.rs +0 -0
  102. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/pseudo.rs +0 -0
  103. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/schema.rs +0 -0
  104. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/series.rs +0 -0
  105. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/state_machine.rs +0 -0
  106. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/buffer_pool.rs +0 -0
  107. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/checksum.rs +0 -0
  108. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/database.rs +0 -0
  109. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/encryption.rs +0 -0
  110. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/mod.rs +0 -0
  111. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/page_cache.rs +0 -0
  112. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/slot_bitmap.rs +0 -0
  113. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/sqlite3_ondisk.rs +0 -0
  114. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/state_machines.rs +0 -0
  115. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/storage/subjournal.rs +0 -0
  116. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/time/internal.rs +0 -0
  117. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/time/mod.rs +0 -0
  118. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/aggregation.rs +0 -0
  119. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/alter.rs +0 -0
  120. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/analyze.rs +0 -0
  121. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/attach.rs +0 -0
  122. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/collate.rs +0 -0
  123. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/compound_select.rs +0 -0
  124. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/delete.rs +0 -0
  125. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/fkeys.rs +0 -0
  126. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/integrity_check.rs +0 -0
  127. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/logical.rs +0 -0
  128. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/mod.rs +0 -0
  129. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/OPTIMIZER.md +0 -0
  130. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/access_method.rs +0 -0
  131. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/constraints.rs +0 -0
  132. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/cost.rs +0 -0
  133. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/join.rs +0 -0
  134. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/lift_common_subexpressions.rs +0 -0
  135. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/optimizer/order.rs +0 -0
  136. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/order_by.rs +0 -0
  137. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/planner.rs +0 -0
  138. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/pragma.rs +0 -0
  139. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/result_row.rs +0 -0
  140. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/rollback.rs +0 -0
  141. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/schema.rs +0 -0
  142. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/transaction.rs +0 -0
  143. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/update.rs +0 -0
  144. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/upsert.rs +0 -0
  145. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/values.rs +0 -0
  146. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/view.rs +0 -0
  147. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/translate/window.rs +0 -0
  148. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/uuid.rs +0 -0
  149. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/likeop.rs +0 -0
  150. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/metrics.rs +0 -0
  151. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vdbe/sorter.rs +0 -0
  152. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/mod.rs +0 -0
  153. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/concat.rs +0 -0
  154. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/convert.rs +0 -0
  155. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/distance_cos.rs +0 -0
  156. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/distance_l2.rs +0 -0
  157. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/jaccard.rs +0 -0
  158. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/mod.rs +0 -0
  159. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/serialize.rs +0 -0
  160. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/slice.rs +0 -0
  161. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/operations/text.rs +0 -0
  162. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vector/vector_types.rs +0 -0
  163. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/core/vtab.rs +0 -0
  164. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/Cargo.toml +0 -0
  165. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/README.md +0 -0
  166. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/build.rs +0 -0
  167. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/src/functions.rs +0 -0
  168. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/src/lib.rs +0 -0
  169. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/src/types.rs +0 -0
  170. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/src/vfs_modules.rs +0 -0
  171. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/extensions/core/src/vtabs.rs +0 -0
  172. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/Cargo.toml +0 -0
  173. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/atomic_enum.rs +0 -0
  174. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/ext/agg_derive.rs +0 -0
  175. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/ext/match_ignore_ascii_case.rs +0 -0
  176. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/ext/mod.rs +0 -0
  177. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/ext/scalars.rs +0 -0
  178. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/ext/vfs_derive.rs +0 -0
  179. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/ext/vtab_derive.rs +0 -0
  180. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/macros/src/lib.rs +0 -0
  181. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/Cargo.toml +0 -0
  182. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/README.md +0 -0
  183. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/benches/parser_benchmark.rs +0 -0
  184. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/ast/check.rs +0 -0
  185. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/ast/fmt.rs +0 -0
  186. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/ast.rs +0 -0
  187. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/error.rs +0 -0
  188. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/lexer.rs +0 -0
  189. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/lib.rs +0 -0
  190. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/parser.rs +0 -0
  191. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/parser/src/token.rs +0 -0
  192. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/pyproject.toml +0 -0
  193. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/turso/__init__.py +0 -0
  194. {pyturso-0.3.0rc5 → pyturso-0.3.0rc6}/turso/py.typed +0 -0
@@ -828,7 +828,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
828
828
 
829
829
  [[package]]
830
830
  name = "core_tester"
831
- version = "0.3.0-pre.5"
831
+ version = "0.3.0-pre.6"
832
832
  dependencies = [
833
833
  "anyhow",
834
834
  "assert_cmd",
@@ -2545,7 +2545,7 @@ dependencies = [
2545
2545
 
2546
2546
  [[package]]
2547
2547
  name = "limbo_completion"
2548
- version = "0.3.0-pre.5"
2548
+ version = "0.3.0-pre.6"
2549
2549
  dependencies = [
2550
2550
  "mimalloc",
2551
2551
  "turso_ext",
@@ -2553,7 +2553,7 @@ dependencies = [
2553
2553
 
2554
2554
  [[package]]
2555
2555
  name = "limbo_crypto"
2556
- version = "0.3.0-pre.5"
2556
+ version = "0.3.0-pre.6"
2557
2557
  dependencies = [
2558
2558
  "blake3",
2559
2559
  "data-encoding",
@@ -2566,7 +2566,7 @@ dependencies = [
2566
2566
 
2567
2567
  [[package]]
2568
2568
  name = "limbo_csv"
2569
- version = "0.3.0-pre.5"
2569
+ version = "0.3.0-pre.6"
2570
2570
  dependencies = [
2571
2571
  "csv",
2572
2572
  "mimalloc",
@@ -2576,7 +2576,7 @@ dependencies = [
2576
2576
 
2577
2577
  [[package]]
2578
2578
  name = "limbo_fuzzy"
2579
- version = "0.3.0-pre.5"
2579
+ version = "0.3.0-pre.6"
2580
2580
  dependencies = [
2581
2581
  "mimalloc",
2582
2582
  "turso_ext",
@@ -2584,7 +2584,7 @@ dependencies = [
2584
2584
 
2585
2585
  [[package]]
2586
2586
  name = "limbo_ipaddr"
2587
- version = "0.3.0-pre.5"
2587
+ version = "0.3.0-pre.6"
2588
2588
  dependencies = [
2589
2589
  "ipnetwork",
2590
2590
  "mimalloc",
@@ -2593,7 +2593,7 @@ dependencies = [
2593
2593
 
2594
2594
  [[package]]
2595
2595
  name = "limbo_percentile"
2596
- version = "0.3.0-pre.5"
2596
+ version = "0.3.0-pre.6"
2597
2597
  dependencies = [
2598
2598
  "mimalloc",
2599
2599
  "turso_ext",
@@ -2601,7 +2601,7 @@ dependencies = [
2601
2601
 
2602
2602
  [[package]]
2603
2603
  name = "limbo_regexp"
2604
- version = "0.3.0-pre.5"
2604
+ version = "0.3.0-pre.6"
2605
2605
  dependencies = [
2606
2606
  "mimalloc",
2607
2607
  "regex",
@@ -2610,7 +2610,7 @@ dependencies = [
2610
2610
 
2611
2611
  [[package]]
2612
2612
  name = "limbo_sim"
2613
- version = "0.3.0-pre.5"
2613
+ version = "0.3.0-pre.6"
2614
2614
  dependencies = [
2615
2615
  "anyhow",
2616
2616
  "bitflags 2.9.4",
@@ -2646,7 +2646,7 @@ dependencies = [
2646
2646
 
2647
2647
  [[package]]
2648
2648
  name = "limbo_sqlite_test_ext"
2649
- version = "0.3.0-pre.5"
2649
+ version = "0.3.0-pre.6"
2650
2650
  dependencies = [
2651
2651
  "cc",
2652
2652
  ]
@@ -3462,7 +3462,7 @@ dependencies = [
3462
3462
 
3463
3463
  [[package]]
3464
3464
  name = "py-turso"
3465
- version = "0.3.0-pre.5"
3465
+ version = "0.3.0-pre.6"
3466
3466
  dependencies = [
3467
3467
  "anyhow",
3468
3468
  "pyo3",
@@ -4208,7 +4208,7 @@ checksum = "d372029cb5195f9ab4e4b9aef550787dce78b124fcaee8d82519925defcd6f0d"
4208
4208
 
4209
4209
  [[package]]
4210
4210
  name = "sql_generation"
4211
- version = "0.3.0-pre.5"
4211
+ version = "0.3.0-pre.6"
4212
4212
  dependencies = [
4213
4213
  "anarchist-readable-name-generator-lib 0.2.0",
4214
4214
  "anyhow",
@@ -4836,7 +4836,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
4836
4836
 
4837
4837
  [[package]]
4838
4838
  name = "turso"
4839
- version = "0.3.0-pre.5"
4839
+ version = "0.3.0-pre.6"
4840
4840
  dependencies = [
4841
4841
  "mimalloc",
4842
4842
  "rand 0.9.2",
@@ -4851,7 +4851,7 @@ dependencies = [
4851
4851
 
4852
4852
  [[package]]
4853
4853
  name = "turso-java"
4854
- version = "0.3.0-pre.5"
4854
+ version = "0.3.0-pre.6"
4855
4855
  dependencies = [
4856
4856
  "jni",
4857
4857
  "thiserror 2.0.16",
@@ -4860,7 +4860,7 @@ dependencies = [
4860
4860
 
4861
4861
  [[package]]
4862
4862
  name = "turso_cli"
4863
- version = "0.3.0-pre.5"
4863
+ version = "0.3.0-pre.6"
4864
4864
  dependencies = [
4865
4865
  "anyhow",
4866
4866
  "cfg-if",
@@ -4896,7 +4896,7 @@ dependencies = [
4896
4896
 
4897
4897
  [[package]]
4898
4898
  name = "turso_core"
4899
- version = "0.3.0-pre.5"
4899
+ version = "0.3.0-pre.6"
4900
4900
  dependencies = [
4901
4901
  "aegis",
4902
4902
  "aes",
@@ -4957,7 +4957,7 @@ dependencies = [
4957
4957
 
4958
4958
  [[package]]
4959
4959
  name = "turso_dart"
4960
- version = "0.3.0-pre.5"
4960
+ version = "0.3.0-pre.6"
4961
4961
  dependencies = [
4962
4962
  "flutter_rust_bridge",
4963
4963
  "turso_core",
@@ -4965,7 +4965,7 @@ dependencies = [
4965
4965
 
4966
4966
  [[package]]
4967
4967
  name = "turso_ext"
4968
- version = "0.3.0-pre.5"
4968
+ version = "0.3.0-pre.6"
4969
4969
  dependencies = [
4970
4970
  "chrono",
4971
4971
  "getrandom 0.3.2",
@@ -4974,7 +4974,7 @@ dependencies = [
4974
4974
 
4975
4975
  [[package]]
4976
4976
  name = "turso_ext_tests"
4977
- version = "0.3.0-pre.5"
4977
+ version = "0.3.0-pre.6"
4978
4978
  dependencies = [
4979
4979
  "env_logger 0.11.7",
4980
4980
  "lazy_static",
@@ -4985,7 +4985,7 @@ dependencies = [
4985
4985
 
4986
4986
  [[package]]
4987
4987
  name = "turso_macros"
4988
- version = "0.3.0-pre.5"
4988
+ version = "0.3.0-pre.6"
4989
4989
  dependencies = [
4990
4990
  "proc-macro2",
4991
4991
  "quote",
@@ -4994,7 +4994,7 @@ dependencies = [
4994
4994
 
4995
4995
  [[package]]
4996
4996
  name = "turso_node"
4997
- version = "0.3.0-pre.5"
4997
+ version = "0.3.0-pre.6"
4998
4998
  dependencies = [
4999
4999
  "chrono",
5000
5000
  "napi",
@@ -5007,7 +5007,7 @@ dependencies = [
5007
5007
 
5008
5008
  [[package]]
5009
5009
  name = "turso_parser"
5010
- version = "0.3.0-pre.5"
5010
+ version = "0.3.0-pre.6"
5011
5011
  dependencies = [
5012
5012
  "bitflags 2.9.4",
5013
5013
  "criterion",
@@ -5023,7 +5023,7 @@ dependencies = [
5023
5023
 
5024
5024
  [[package]]
5025
5025
  name = "turso_sqlite3"
5026
- version = "0.3.0-pre.5"
5026
+ version = "0.3.0-pre.6"
5027
5027
  dependencies = [
5028
5028
  "env_logger 0.11.7",
5029
5029
  "libc",
@@ -5036,7 +5036,7 @@ dependencies = [
5036
5036
 
5037
5037
  [[package]]
5038
5038
  name = "turso_stress"
5039
- version = "0.3.0-pre.5"
5039
+ version = "0.3.0-pre.6"
5040
5040
  dependencies = [
5041
5041
  "anarchist-readable-name-generator-lib 0.1.2",
5042
5042
  "antithesis_sdk",
@@ -5053,7 +5053,7 @@ dependencies = [
5053
5053
 
5054
5054
  [[package]]
5055
5055
  name = "turso_sync_engine"
5056
- version = "0.3.0-pre.5"
5056
+ version = "0.3.0-pre.6"
5057
5057
  dependencies = [
5058
5058
  "base64 0.22.1",
5059
5059
  "bytes",
@@ -5080,7 +5080,7 @@ dependencies = [
5080
5080
 
5081
5081
  [[package]]
5082
5082
  name = "turso_sync_js"
5083
- version = "0.3.0-pre.5"
5083
+ version = "0.3.0-pre.6"
5084
5084
  dependencies = [
5085
5085
  "genawaiter",
5086
5086
  "napi",
@@ -5095,7 +5095,7 @@ dependencies = [
5095
5095
 
5096
5096
  [[package]]
5097
5097
  name = "turso_whopper"
5098
- version = "0.3.0-pre.5"
5098
+ version = "0.3.0-pre.6"
5099
5099
  dependencies = [
5100
5100
  "anyhow",
5101
5101
  "clap",
@@ -8,29 +8,29 @@ exclude = [
8
8
  ]
9
9
 
10
10
  [workspace.package]
11
- version = "0.3.0-pre.5"
11
+ version = "0.3.0-pre.6"
12
12
  authors = ["the Limbo authors"]
13
13
  edition = "2021"
14
14
  license = "MIT"
15
15
  repository = "https://github.com/tursodatabase/turso"
16
16
 
17
17
  [workspace.dependencies]
18
- turso = { path = "bindings/rust", version = "0.3.0-pre.5" }
19
- turso_node = { path = "bindings/javascript", version = "0.3.0-pre.5" }
20
- limbo_completion = { path = "extensions/completion", version = "0.3.0-pre.5" }
21
- turso_core = { path = "core", version = "0.3.0-pre.5" }
22
- turso_sync_engine = { path = "sync/engine", version = "0.3.0-pre.5" }
23
- limbo_crypto = { path = "extensions/crypto", version = "0.3.0-pre.5" }
24
- limbo_csv = { path = "extensions/csv", version = "0.3.0-pre.5" }
25
- turso_ext = { path = "extensions/core", version = "0.3.0-pre.5" }
26
- turso_ext_tests = { path = "extensions/tests", version = "0.3.0-pre.5" }
27
- limbo_ipaddr = { path = "extensions/ipaddr", version = "0.3.0-pre.5" }
28
- turso_macros = { path = "macros", version = "0.3.0-pre.5" }
29
- limbo_percentile = { path = "extensions/percentile", version = "0.3.0-pre.5" }
30
- limbo_regexp = { path = "extensions/regexp", version = "0.3.0-pre.5" }
31
- limbo_uuid = { path = "extensions/uuid", version = "0.3.0-pre.5" }
32
- turso_parser = { path = "parser", version = "0.3.0-pre.5" }
33
- limbo_fuzzy = { path = "extensions/fuzzy", version = "0.3.0-pre.5" }
18
+ turso = { path = "bindings/rust", version = "0.3.0-pre.6" }
19
+ turso_node = { path = "bindings/javascript", version = "0.3.0-pre.6" }
20
+ limbo_completion = { path = "extensions/completion", version = "0.3.0-pre.6" }
21
+ turso_core = { path = "core", version = "0.3.0-pre.6" }
22
+ turso_sync_engine = { path = "sync/engine", version = "0.3.0-pre.6" }
23
+ limbo_crypto = { path = "extensions/crypto", version = "0.3.0-pre.6" }
24
+ limbo_csv = { path = "extensions/csv", version = "0.3.0-pre.6" }
25
+ turso_ext = { path = "extensions/core", version = "0.3.0-pre.6" }
26
+ turso_ext_tests = { path = "extensions/tests", version = "0.3.0-pre.6" }
27
+ limbo_ipaddr = { path = "extensions/ipaddr", version = "0.3.0-pre.6" }
28
+ turso_macros = { path = "macros", version = "0.3.0-pre.6" }
29
+ limbo_percentile = { path = "extensions/percentile", version = "0.3.0-pre.6" }
30
+ limbo_regexp = { path = "extensions/regexp", version = "0.3.0-pre.6" }
31
+ limbo_uuid = { path = "extensions/uuid", version = "0.3.0-pre.6" }
32
+ turso_parser = { path = "parser", version = "0.3.0-pre.6" }
33
+ limbo_fuzzy = { path = "extensions/fuzzy", version = "0.3.0-pre.6" }
34
34
  sql_generation = { path = "sql_generation" }
35
35
  strum = { version = "0.26", features = ["derive"] }
36
36
  strum_macros = "0.26"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyturso
3
- Version: 0.3.0rc5
3
+ Version: 0.3.0rc6
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Programming Language :: Python
6
6
  Classifier: Programming Language :: Python :: 3
@@ -87,7 +87,9 @@ pub trait IndexMethodCursor {
87
87
  /// For example, for 2 patterns ["SELECT * FROM {table} LIMIT ?", "SELECT * FROM {table} WHERE x = ?"], query_start(...) call can have following arguments:
88
88
  /// - [Integer(0), Integer(10)] - pattern "SELECT * FROM {table} LIMIT ?" was chosen with LIMIT parameter equals to 10
89
89
  /// - [Integer(1), Text("turso")] - pattern "SELECT * FROM {table} WHERE x = ?" was chosen with equality comparison equals to "turso"
90
- fn query_start(&mut self, values: &[Register]) -> Result<IOResult<()>>;
90
+ ///
91
+ /// Returns false if query will produce no rows (similar to VFilter/Rewind op codes)
92
+ fn query_start(&mut self, values: &[Register]) -> Result<IOResult<bool>>;
91
93
 
92
94
  /// Moves cursor to the next response row
93
95
  /// Returns false if query exhausted all rows
@@ -43,6 +43,7 @@ pub enum VectorSparseInvertedIndexCreateState {
43
43
  Run { stmt: Box<Statement> },
44
44
  }
45
45
 
46
+ #[derive(Debug)]
46
47
  pub enum VectorSparseInvertedIndexInsertState {
47
48
  Init,
48
49
  Prepare {
@@ -64,6 +65,7 @@ pub enum VectorSparseInvertedIndexInsertState {
64
65
  },
65
66
  }
66
67
 
68
+ #[derive(Debug)]
67
69
  pub enum VectorSparseInvertedIndexDeleteState {
68
70
  Init,
69
71
  Prepare {
@@ -151,7 +153,6 @@ pub struct VectorSparseInvertedIndexMethodCursor {
151
153
  delete_state: VectorSparseInvertedIndexDeleteState,
152
154
  search_state: VectorSparseInvertedIndexSearchState,
153
155
  search_result: VecDeque<(i64, f64)>,
154
- search_row: Option<(i64, f64)>,
155
156
  }
156
157
 
157
158
  impl IndexMethod for VectorSparseInvertedIndexMethod {
@@ -199,7 +200,6 @@ impl VectorSparseInvertedIndexMethodCursor {
199
200
  scratch_cursor: None,
200
201
  main_btree: None,
201
202
  search_result: VecDeque::new(),
202
- search_row: None,
203
203
  create_state: VectorSparseInvertedIndexCreateState::Init,
204
204
  insert_state: VectorSparseInvertedIndexInsertState::Init,
205
205
  delete_state: VectorSparseInvertedIndexDeleteState::Init,
@@ -288,6 +288,7 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
288
288
  ));
289
289
  };
290
290
  loop {
291
+ tracing::debug!("insert_state: {:?}", self.insert_state);
291
292
  match &mut self.insert_state {
292
293
  VectorSparseInvertedIndexInsertState::Init => {
293
294
  let Some(vector) = values[0].get_value().to_blob() else {
@@ -377,6 +378,7 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
377
378
  ));
378
379
  };
379
380
  loop {
381
+ tracing::debug!("delete_state: {:?}", self.delete_state);
380
382
  match &mut self.delete_state {
381
383
  VectorSparseInvertedIndexDeleteState::Init => {
382
384
  let Some(vector) = values[0].get_value().to_blob() else {
@@ -459,7 +461,7 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
459
461
  }
460
462
  }
461
463
 
462
- fn query_start(&mut self, values: &[Register]) -> Result<IOResult<()>> {
464
+ fn query_start(&mut self, values: &[Register]) -> Result<IOResult<bool>> {
463
465
  let Some(scratch) = &mut self.scratch_cursor else {
464
466
  return Err(LimboError::InternalError(
465
467
  "cursor must be opened".to_string(),
@@ -471,7 +473,7 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
471
473
  ));
472
474
  };
473
475
  loop {
474
- tracing::debug!("state: {:?}", self.search_state);
476
+ tracing::debug!("query_state: {:?}", self.search_state);
475
477
  match &mut self.search_state {
476
478
  VectorSparseInvertedIndexSearchState::Init => {
477
479
  let Some(vector) = values[1].get_value().to_blob() else {
@@ -521,7 +523,7 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
521
523
  continue;
522
524
  }
523
525
  let position = p[*idx];
524
- let key = ImmutableRecord::from_values(&[Value::Integer(position as i64)], 2);
526
+ let key = ImmutableRecord::from_values(&[Value::Integer(position as i64)], 1);
525
527
  self.search_state = VectorSparseInvertedIndexSearchState::Seek {
526
528
  collected: collected.take(),
527
529
  positions: positions.take(),
@@ -551,7 +553,7 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
551
553
  limit: *limit,
552
554
  };
553
555
  }
554
- SeekResult::TryAdvance => {
556
+ SeekResult::TryAdvance | SeekResult::NotFound => {
555
557
  self.search_state = VectorSparseInvertedIndexSearchState::Next {
556
558
  collected: collected.take(),
557
559
  positions: positions.take(),
@@ -560,9 +562,6 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
560
562
  limit: *limit,
561
563
  };
562
564
  }
563
- SeekResult::NotFound => {
564
- return Err(LimboError::Corrupt("inverted index corrupted".to_string()))
565
- }
566
565
  }
567
566
  }
568
567
  VectorSparseInvertedIndexSearchState::Read {
@@ -637,7 +636,7 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
637
636
  let Some(rowid) = rowids.as_ref().unwrap().last() else {
638
637
  let distances = distances.take().unwrap();
639
638
  self.search_result = distances.iter().map(|(d, i)| (*i, d.0)).collect();
640
- return Ok(IOResult::Done(()));
639
+ return Ok(IOResult::Done(!self.search_result.is_empty()));
641
640
  };
642
641
  let result = return_if_io!(
643
642
  main.seek(SeekKey::TableRowId(*rowid), SeekOp::GE { eq_only: true })
@@ -709,17 +708,17 @@ impl IndexMethodCursor for VectorSparseInvertedIndexMethodCursor {
709
708
  }
710
709
 
711
710
  fn query_rowid(&mut self) -> Result<IOResult<Option<i64>>> {
712
- let result = self.search_row.as_ref().unwrap();
711
+ let result = self.search_result.front().unwrap();
713
712
  Ok(IOResult::Done(Some(result.0)))
714
713
  }
715
714
 
716
715
  fn query_column(&mut self, _: usize) -> Result<IOResult<Value>> {
717
- let result = self.search_row.as_ref().unwrap();
716
+ let result = self.search_result.front().unwrap();
718
717
  Ok(IOResult::Done(Value::Float(result.1)))
719
718
  }
720
719
 
721
720
  fn query_next(&mut self) -> Result<IOResult<bool>> {
722
- self.search_row = self.search_result.pop_front();
723
- Ok(IOResult::Done(self.search_row.is_some()))
721
+ let _ = self.search_result.pop_front();
722
+ Ok(IOResult::Done(!self.search_result.is_empty()))
724
723
  }
725
724
  }
@@ -1212,7 +1212,7 @@ impl Connection {
1212
1212
  }
1213
1213
 
1214
1214
  let sql = sql.as_ref();
1215
- tracing::trace!("Preparing: {}", sql);
1215
+ tracing::debug!("Preparing: {}", sql);
1216
1216
  let mut parser = Parser::new(sql.as_bytes());
1217
1217
  let cmd = parser.next_cmd()?;
1218
1218
  let syms = self.syms.read();
@@ -2589,6 +2589,9 @@ impl BTreeCursor {
2589
2589
  /// 4. Continue balance from the parent page (inserting the new divider cell may have overflowed the parent)
2590
2590
  #[instrument(skip(self), level = Level::DEBUG)]
2591
2591
  fn balance_quick(&mut self) -> Result<IOResult<()>> {
2592
+ // Since we are going to change the btree structure, let's forget our cached knowledge of the rightmost page.
2593
+ let _ = self.move_to_right_state.1.take();
2594
+
2592
2595
  // Allocate a new leaf page and insert the overflow cell payload in it.
2593
2596
  let new_rightmost_leaf = return_if_io!(self.pager.do_allocate_page(
2594
2597
  PageType::TableLeaf,
@@ -1528,7 +1528,7 @@ impl Pager {
1528
1528
  allow_empty_read: bool,
1529
1529
  ) -> Result<(PageRef, Completion)> {
1530
1530
  assert!(page_idx >= 0);
1531
- tracing::trace!("read_page_no_cache(page_idx = {})", page_idx);
1531
+ tracing::debug!("read_page_no_cache(page_idx = {})", page_idx);
1532
1532
  let page = Arc::new(Page::new(page_idx));
1533
1533
  let io_ctx = self.io_ctx.read();
1534
1534
  let Some(wal) = self.wal.as_ref() else {
@@ -1565,11 +1565,11 @@ impl Pager {
1565
1565
  #[tracing::instrument(skip_all, level = Level::DEBUG)]
1566
1566
  pub fn read_page(&self, page_idx: i64) -> Result<(PageRef, Option<Completion>)> {
1567
1567
  assert!(page_idx >= 0, "pages in pager should be positive, negative might indicate unallocated pages from mvcc or any other nasty bug");
1568
- tracing::trace!("read_page(page_idx = {})", page_idx);
1568
+ tracing::debug!("read_page(page_idx = {})", page_idx);
1569
1569
  let mut page_cache = self.page_cache.write();
1570
1570
  let page_key = PageCacheKey::new(page_idx as usize);
1571
1571
  if let Some(page) = page_cache.get(&page_key)? {
1572
- tracing::trace!("read_page(page_idx = {}) = cached", page_idx);
1572
+ tracing::debug!("read_page(page_idx = {}) = cached", page_idx);
1573
1573
  turso_assert!(
1574
1574
  page_idx as usize == page.get().id,
1575
1575
  "attempted to read page {page_idx} but got page {}",
@@ -1139,7 +1139,7 @@ impl Wal for WalFile {
1139
1139
 
1140
1140
  #[instrument(skip_all, level = Level::DEBUG)]
1141
1141
  fn read_frame_raw(&self, frame_id: u64, frame: &mut [u8]) -> Result<Completion> {
1142
- tracing::debug!("read_frame({})", frame_id);
1142
+ tracing::debug!("read_frame_raw({})", frame_id);
1143
1143
  let offset = self.frame_offset(frame_id);
1144
1144
  let (frame_ptr, frame_len) = (frame.as_mut_ptr(), frame.len());
1145
1145
 
@@ -1511,6 +1511,7 @@ impl Wal for WalFile {
1511
1511
  let mut next_frame_id = self.max_frame.load(Ordering::Acquire) + 1;
1512
1512
  // Build every frame in order, updating the rolling checksum
1513
1513
  for (idx, page) in pages.iter().enumerate() {
1514
+ tracing::debug!("append_frames_vectored: page_id={}", page.get().id);
1514
1515
  let page_id = page.get().id;
1515
1516
  let plain = page.get_contents().as_ptr();
1516
1517
 
@@ -119,6 +119,15 @@ impl Display for SelectPlan {
119
119
  )?;
120
120
  }
121
121
  },
122
+ Operation::IndexMethodQuery(query) => {
123
+ let index_method = query.index.index_method.as_ref().unwrap();
124
+ writeln!(
125
+ f,
126
+ "{}QUERY INDEX METHOD {}",
127
+ indent,
128
+ index_method.definition().method_name
129
+ )?;
130
+ }
122
131
  }
123
132
  }
124
133
  Ok(())
@@ -161,6 +170,15 @@ impl Display for DeletePlan {
161
170
  )?;
162
171
  }
163
172
  },
173
+ Operation::IndexMethodQuery(query) => {
174
+ let module = query.index.index_method.as_ref().unwrap();
175
+ writeln!(
176
+ f,
177
+ "{}QUERY MODULE {}",
178
+ indent,
179
+ module.definition().method_name
180
+ )?;
181
+ }
164
182
  }
165
183
  }
166
184
  Ok(())
@@ -215,6 +233,15 @@ impl fmt::Display for UpdatePlan {
215
233
  )?;
216
234
  }
217
235
  },
236
+ Operation::IndexMethodQuery(query) => {
237
+ let module = query.index.index_method.as_ref().unwrap();
238
+ writeln!(
239
+ f,
240
+ "{}QUERY MODULE {}",
241
+ indent,
242
+ module.definition().method_name
243
+ )?;
244
+ }
218
245
  }
219
246
  }
220
247
  if !self.order_by.is_empty() {
@@ -35,8 +35,9 @@ use crate::translate::fkeys::{
35
35
  emit_fk_delete_parent_existence_checks, emit_guarded_fk_decrement,
36
36
  emit_parent_key_change_checks, open_read_index, open_read_table, stabilize_new_row_for_fk,
37
37
  };
38
- use crate::translate::plan::{DeletePlan, JoinedTable, Plan, QueryDestination, Search};
38
+ use crate::translate::plan::{DeletePlan, EvalAt, JoinedTable, Plan, QueryDestination, Search};
39
39
  use crate::translate::planner::ROWID_STRS;
40
+ use crate::translate::subquery::emit_non_from_clause_subquery;
40
41
  use crate::translate::values::emit_values;
41
42
  use crate::translate::window::{emit_window_results, init_window, WindowMetadata};
42
43
  use crate::util::{exprs_are_equivalent, normalize_ident};
@@ -272,14 +273,33 @@ pub fn emit_query<'a>(
272
273
  let after_main_loop_label = program.allocate_label();
273
274
  t_ctx.label_main_loop_end = Some(after_main_loop_label);
274
275
 
275
- init_limit(program, t_ctx, &plan.limit, &plan.offset)?;
276
-
277
276
  if !plan.values.is_empty() {
278
277
  let reg_result_cols_start = emit_values(program, plan, t_ctx)?;
279
278
  program.preassign_label_to_next_insn(after_main_loop_label);
280
279
  return Ok(reg_result_cols_start);
281
280
  }
282
281
 
282
+ // Evaluate uncorrelated subqueries as early as possible, because even LIMIT can reference a subquery.
283
+ for subquery in plan
284
+ .non_from_clause_subqueries
285
+ .iter_mut()
286
+ .filter(|s| !s.has_been_evaluated())
287
+ {
288
+ let eval_at = subquery.get_eval_at(&plan.join_order)?;
289
+ if eval_at != EvalAt::BeforeLoop {
290
+ continue;
291
+ }
292
+ let plan = subquery.consume_plan(EvalAt::BeforeLoop);
293
+
294
+ emit_non_from_clause_subquery(
295
+ program,
296
+ t_ctx,
297
+ *plan,
298
+ &subquery.query_type,
299
+ subquery.correlated,
300
+ )?;
301
+ }
302
+
283
303
  // Emit FROM clause subqueries first so the results can be read in the main query loop.
284
304
  emit_from_clause_subqueries(program, t_ctx, &mut plan.table_references)?;
285
305
 
@@ -356,6 +376,9 @@ pub fn emit_query<'a>(
356
376
  if let Distinctness::Distinct { ctx } = &mut plan.distinctness {
357
377
  *ctx = distinct_ctx
358
378
  }
379
+
380
+ init_limit(program, t_ctx, &plan.limit, &plan.offset)?;
381
+
359
382
  init_loop(
360
383
  program,
361
384
  t_ctx,
@@ -670,6 +693,9 @@ fn emit_delete_insns(
670
693
  index: Some(index), ..
671
694
  } => program.resolve_cursor_id(&CursorKey::index(internal_id, index.clone())),
672
695
  },
696
+ Operation::IndexMethodQuery(_) => {
697
+ panic!("access through IndexMethod is not supported for delete statements")
698
+ }
673
699
  };
674
700
  let main_table_cursor_id = program.resolve_cursor_id(&CursorKey::table(internal_id));
675
701
 
@@ -980,7 +1006,7 @@ fn emit_program_for_update(
980
1006
  )) {
981
1007
  cursor
982
1008
  } else {
983
- let cursor = program.alloc_cursor_id(CursorType::BTreeIndex(index.clone()));
1009
+ let cursor = program.alloc_cursor_index(None, index)?;
984
1010
  program.emit_insn(Insn::OpenWrite {
985
1011
  cursor_id: cursor,
986
1012
  root_page: RegisterOrLiteral::Literal(index.root_page),
@@ -1087,6 +1113,9 @@ fn emit_update_insns(
1087
1113
  false,
1088
1114
  ),
1089
1115
  },
1116
+ Operation::IndexMethodQuery(_) => {
1117
+ panic!("access through IndexMethod is not supported for update operations")
1118
+ }
1090
1119
  };
1091
1120
 
1092
1121
  let beg = program.alloc_registers(
@@ -2073,7 +2102,7 @@ fn init_limit(
2073
2102
  _ => {
2074
2103
  let r = limit_ctx.reg_limit;
2075
2104
 
2076
- _ = translate_expr(program, None, expr, r, &t_ctx.resolver);
2105
+ _ = translate_expr(program, None, expr, r, &t_ctx.resolver)?;
2077
2106
  program.emit_insn(Insn::MustBeInt { reg: r });
2078
2107
  }
2079
2108
  }
@@ -2103,7 +2132,7 @@ fn init_limit(
2103
2132
  }
2104
2133
  }
2105
2134
  _ => {
2106
- _ = translate_expr(program, None, expr, offset_reg, &t_ctx.resolver);
2135
+ _ = translate_expr(program, None, expr, offset_reg, &t_ctx.resolver)?;
2107
2136
  }
2108
2137
  }
2109
2138
  program.add_comment(program.offset(), "OFFSET counter");