Skip to content

Commit 7a314c5

Browse files
committed
2 parents 2a127a7 + 4f8ac88 commit 7a314c5

22 files changed

Lines changed: 239 additions & 154 deletions

File tree

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ resolver = "3"
2727
# `package =` key so the import name stays `sqlrite` internally:
2828
# sqlrite = { package = "sqlrite-engine", path = "…" }
2929
name = "sqlrite-engine"
30-
version = "0.10.0"
30+
version = "0.10.1"
3131
authors = ["Joao Henrique Machado Silva <joaoh82@gmail.com>"]
3232
edition = "2024"
3333
rust-version = "1.85"
@@ -150,4 +150,4 @@ fs2 = { version = "0.4", optional = true }
150150
# crate publishes to crates.io, and a path-only dep without a
151151
# version field fails the manifest verification step. See PR #58
152152
# retrospective in docs/roadmap.md.
153-
sqlrite-ask = { version = "0.10.0", path = "sqlrite-ask", optional = true }
153+
sqlrite-ask = { version = "0.10.1", path = "sqlrite-ask", optional = true }

benchmarks/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ duckdb = ["dep:duckdb"]
5050
# The engine. Default features off (no rustyline / clap / `ask`), but
5151
# `file-locks` is on so the comparison runs the same lock-acquisition
5252
# path that any real SQLRite consumer pays.
53-
sqlrite = { package = "sqlrite-engine", path = "..", version = "0.10.0", default-features = false, features = ["file-locks"] }
53+
sqlrite = { package = "sqlrite-engine", path = "..", version = "0.10.1", default-features = false, features = ["file-locks"] }
5454

5555
# SQLite via rusqlite, with `bundled` so the comparison is against a
5656
# known SQLite version (not whatever happens to be on the host).

desktop/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sqlrite-desktop-frontend",
33
"private": true,
4-
"version": "0.10.0",
4+
"version": "0.10.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlrite-desktop"
3-
version = "0.10.0"
3+
version = "0.10.1"
44
description = "SQLRite desktop app — Tauri 2 shell around the engine"
55
authors = ["Joao Henrique Machado Silva <joaoh82@gmail.com>"]
66
edition = "2024"

desktop/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "SQLRite",
4-
"version": "0.10.0",
4+
"version": "0.10.1",
55
"identifier": "com.sqlrite.desktop",
66
"build": {
77
"beforeDevCommand": "npm run dev",

docs/sql-engine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Two specialized shortcuts in [`src/sql/executor.rs`](../src/sql/executor.rs) rec
133133
ORDER BY vec_distance_l2(<col>, <bracket-array literal>) ASC LIMIT k
134134
```
135135

136-
Returns top-k from the HNSW graph in `O(log N)` per probe. Mirrored shapes for `vec_distance_cosine` and `vec_distance_dot`.
136+
Returns top-k from the HNSW graph in `O(log N)` per probe. Mirrored shapes for `vec_distance_cosine` and `vec_distance_dot`. INSERT maintains HNSW incrementally. DELETE / UPDATE mark the graph dirty; the next INSERT on the indexed vector column rebuilds the in-memory graph from surviving rows before adding the new node, and save/COMMIT still rebuilds dirty graphs before serializing.
137137

138138
`try_fts_probe` (Phase 8b) — BM25 keyword:
139139

examples/nodejs-notes/README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,6 @@ Default is 0.5.
247247
time and won't notice newly-ingested files until you reload it
248248
anyway, so the gain from coexisting isn't worth the surprise.
249249

250-
- **HNSW after delete + re-insert (engine bug, SQLR-8).** The
251-
engine's HNSW chunk index panics when rows are deleted and re-
252-
inserted within the same connection lifetime — `index out of
253-
bounds` inside `DistanceMetric::compute`. The ingest pipeline
254-
works around it by splitting refresh into a delete-phase →
255-
close/reopen → insert-phase, which forces a clean index rebuild
256-
on next open. We pay the close/reopen hop only when there are
257-
actual deletions (so first-time `init` skips it). Once SQLR-8
258-
lands in the engine, `src/ingest.mjs` can drop the `db.reopen()`
259-
call.
260-
261250
- **Aggregates limited.** The engine supports `COUNT(*)`,
262251
`SUM`/`AVG`/`MIN`/`MAX` but not arbitrary expressions in `SELECT`
263252
projection beyond aggregates (see [`docs/supported-sql.md`](../../docs/supported-sql.md)).
@@ -319,7 +308,7 @@ examples/nodejs-notes/
319308
│ ├── db.mjs # schema, migrations, every SQL string
320309
│ ├── chunker.mjs # frontmatter + heading-aware chunking
321310
│ ├── embeddings.mjs # hash + OpenAI embedders
322-
│ ├── ingest.mjs # plan → delete → reopen → insert
311+
│ ├── ingest.mjs # plan → delete → insert
323312
│ ├── search.mjs # hybrid retrieval driver
324313
│ ├── serve.mjs # spawn sqlrite-mcp --read-only
325314
│ └── claude-config.mjs # Claude Desktop snippet renderer

examples/nodejs-notes/src/ingest.mjs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
//
1111
// Both flow through `ingestImpl`, which splits the work into three
1212
// phases: PLAN (read-only diff against the current DB) → DELETE (drop
13-
// stale documents/chunks; close + reopen the DB) → INSERT (write new
14-
// rows). The close/reopen between DELETE and INSERT is a workaround
15-
// for an engine bug where the HNSW chunk index panics when rows are
16-
// deleted and re-inserted in the same connection lifetime — see the
17-
// "Known limitations" section of this example's README.
13+
// stale documents/chunks) → INSERT (write new rows).
1814

1915
import { readFile, readdir, stat } from 'node:fs/promises';
2016
import { createHash } from 'node:crypto';
@@ -192,23 +188,13 @@ async function ingestImpl({ db, root, embedder, logger, chunkOpts, mode }) {
192188

193189
// ----------------------------------------------------------------
194190
// PHASE 2 — deletes (and replacing-deletes).
195-
//
196-
// The engine's HNSW index has a bug where rows deleted and re-
197-
// inserted within the same connection lifetime can corrupt the
198-
// index's stored vectors (see ../README.md "Known limitations").
199-
// Closing + reopening the connection between the delete-pass and
200-
// the insert-pass forces a full index rebuild on next open,
201-
// sidestepping the issue. We only pay this cost when there's
202-
// actually something to delete; pure-INSERT runs (first `init`)
203-
// skip this hop entirely.
204191
if (hasMutations) {
205192
db.transaction(() => {
206193
for (const id of planDeletes) db.deleteDocument(id);
207194
for (const e of embedded) {
208195
if (e.plan.priorId !== null) db.deleteDocument(e.plan.priorId);
209196
}
210197
});
211-
db.reopen();
212198
}
213199

214200
// ----------------------------------------------------------------

sdk/nodejs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqlrite-nodejs"
3-
version = "0.10.0"
3+
version = "0.10.1"
44
authors = ["Joao Henrique Machado Silva <joaoh82@gmail.com>"]
55
edition = "2024"
66
rust-version = "1.85"

0 commit comments

Comments
 (0)