sqlrite 0.1.23__tar.gz → 0.1.25__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.
- {sqlrite-0.1.23 → sqlrite-0.1.25}/.github/workflows/release.yml +161 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/Cargo.lock +30 -6
- {sqlrite-0.1.23 → sqlrite-0.1.25}/Cargo.toml +1 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/PKG-INFO +5 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/README.md +39 -8
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/package.json +1 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/_index.md +13 -6
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/architecture.md +39 -14
- sqlrite-0.1.25/docs/ask-backend-examples.md +411 -0
- sqlrite-0.1.25/docs/ask.md +453 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/desktop.md +1 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/embedding.md +9 -6
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/getting-started.md +19 -6
- sqlrite-0.1.25/docs/mcp.md +353 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/phase-7-plan.md +10 -6
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/release-plan.md +13 -5
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/roadmap.md +6 -4
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/smoke-test.md +7 -4
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/supported-sql.md +13 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/usage.md +1 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/README.md +1 -0
- sqlrite-0.1.25/examples/wasm/Makefile +53 -0
- sqlrite-0.1.25/examples/wasm/index.html +288 -0
- sqlrite-0.1.25/examples/wasm/server.mjs +167 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/pyproject.toml +1 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/scripts/bump-version.sh +1 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/README.md +4 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/python/Cargo.toml +1 -1
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/python/README.md +4 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sqlrite-ask/Cargo.toml +26 -2
- sqlrite-0.1.25/sqlrite-ask/README.md +88 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sqlrite-ask/src/lib.rs +22 -4
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sqlrite-ask/src/provider/mod.rs +6 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/ask/mod.rs +21 -3
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/lib.rs +8 -1
- sqlrite-0.1.23/examples/wasm/Makefile +0 -30
- sqlrite-0.1.23/examples/wasm/index.html +0 -134
- {sqlrite-0.1.23 → sqlrite-0.1.25}/.github/workflows/ci.yml +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/.github/workflows/release-pr.yml +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/.github/workflows/rust.yml +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/.gitignore +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/CODE_OF_CONDUCT.md +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/LICENSE +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/MAINTAINERS +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/Makefile +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/index.html +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/package-lock.json +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/src/App.svelte +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/src/app.css +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/src/main.ts +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/src/vite-env.d.ts +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/svelte.config.js +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/tsconfig.json +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/desktop/vite.config.ts +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/design-decisions.md +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/file-format.md +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/pager.md +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/release-secrets.md +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/sql-engine.md +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/docs/storage-model.md +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/c/Makefile +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/c/hello.c +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/go/go.mod +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/go/hello.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/nodejs/hello.mjs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/python/hello.py +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/examples/rust/quickstart.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/images/SQLRite - Desktop.png +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/images/SQLRite Data Structures.png +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/images/SQLRite Simple SQL Execution High Level Diagram.png +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/images/SQLRite Simple SQL INSERT Execution High Level Diagram (Insert Row).png +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/images/SQLRite Simple SQL INSERT Execution High Level Diagram.png +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/images/SQLRite_logo.png +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/images/architecture.png +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/rust-toolchain.toml +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/AST.delete.example +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/AST.insert.exemple +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/AST.select.example +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/AST.update.example +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/CREATE TABLE sqlrite_schema.sql +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/CREATE_TABLE with duplicate.sql +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/CREATE_TABLE.sql +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/samples/INSERT.sql +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/ask.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/ask_test.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/conn.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/go.mod +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/rows.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/sqlrite.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/sqlrite_test.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/go/stmt.go +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/python/src/lib.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/python/tests/test_ask.py +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sdk/python/tests/test_sqlrite.py +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sqlrite-ask/src/prompt.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sqlrite-ask/src/provider/anthropic.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sqlrite-ask/src/provider/mock.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/sqlrite-ask/tests/anthropic_http.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/ask/schema.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/connection.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/error.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/main.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/meta_command/mod.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/repl/mod.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/db/database.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/db/mod.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/db/secondary_index.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/db/table.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/executor.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/hnsw.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/mod.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/cell.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/file.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/header.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/hnsw_cell.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/index_cell.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/interior_page.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/mod.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/overflow.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/page.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/pager.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/table_page.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/varint.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/pager/wal.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/parser/create.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/parser/insert.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/parser/mod.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/parser/select.rs +0 -0
- {sqlrite-0.1.23 → sqlrite-0.1.25}/src/sql/tokenizer.rs +0 -0
|
@@ -127,6 +127,7 @@ jobs:
|
|
|
127
127
|
"sqlrite-v$V"
|
|
128
128
|
"sqlrite-ffi-v$V"
|
|
129
129
|
"sqlrite-ask-v$V"
|
|
130
|
+
"sqlrite-mcp-v$V"
|
|
130
131
|
"sqlrite-desktop-v$V"
|
|
131
132
|
"sqlrite-py-v$V"
|
|
132
133
|
"sqlrite-node-v$V"
|
|
@@ -267,6 +268,164 @@ jobs:
|
|
|
267
268
|
See the umbrella release [v${{ needs.detect.outputs.version }}](../../releases/tag/v${{ needs.detect.outputs.version }}) for the full changelog.
|
|
268
269
|
generate_release_notes: true
|
|
269
270
|
|
|
271
|
+
# ---------------------------------------------------------------------------
|
|
272
|
+
# Step 3a'': publish the `sqlrite-mcp` crate (Phase 7h) — Model
|
|
273
|
+
# Context Protocol server adapter that exposes SQLRite as a
|
|
274
|
+
# stdio-spawned tool surface for LLM agents (Claude Code, Cursor,
|
|
275
|
+
# mcp-inspector, etc.). Same shape as `publish-ask` above; gated
|
|
276
|
+
# `needs: publish-crate, publish-ask` because sqlrite-mcp depends
|
|
277
|
+
# on both (the engine via `default-features = false` + the engine's
|
|
278
|
+
# `ask` feature for the natural-language → SQL `ask` tool).
|
|
279
|
+
#
|
|
280
|
+
# Crate name on crates.io: `sqlrite-mcp`. Binary name produced by
|
|
281
|
+
# `cargo install`: `sqlrite-mcp` (one [[bin]] target). Per-platform
|
|
282
|
+
# prebuilt binary tarballs are produced by `build-mcp-binaries`
|
|
283
|
+
# below — `cargo install` is the from-source path.
|
|
284
|
+
publish-mcp:
|
|
285
|
+
name: Publish sqlrite-mcp crate to crates.io
|
|
286
|
+
needs: [detect, tag-all, publish-crate, publish-ask]
|
|
287
|
+
if: needs.detect.outputs.should_release == 'true'
|
|
288
|
+
runs-on: ubuntu-latest
|
|
289
|
+
environment: release
|
|
290
|
+
steps:
|
|
291
|
+
- uses: actions/checkout@v4
|
|
292
|
+
|
|
293
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
294
|
+
|
|
295
|
+
- uses: Swatinem/rust-cache@v2
|
|
296
|
+
with:
|
|
297
|
+
shared-key: publish-mcp
|
|
298
|
+
|
|
299
|
+
- name: cargo publish
|
|
300
|
+
env:
|
|
301
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
|
|
302
|
+
# `--no-verify` mirrors `publish-crate` / `publish-ask` —
|
|
303
|
+
# Release-PR CI already validated this commit.
|
|
304
|
+
#
|
|
305
|
+
# `needs: [..., publish-crate, publish-ask]` is load-bearing:
|
|
306
|
+
# sqlrite-mcp's path-dep on sqlrite-engine + (transitive)
|
|
307
|
+
# sqlrite-ask only resolves on crates.io once both have been
|
|
308
|
+
# published at the matching version. crates.io rejects
|
|
309
|
+
# path-dep publishes whose path-dep version isn't reachable.
|
|
310
|
+
run: cargo publish -p sqlrite-mcp --no-verify
|
|
311
|
+
|
|
312
|
+
- name: GitHub Release
|
|
313
|
+
uses: softprops/action-gh-release@v2
|
|
314
|
+
with:
|
|
315
|
+
tag_name: sqlrite-mcp-v${{ needs.detect.outputs.version }}
|
|
316
|
+
name: sqlrite-mcp v${{ needs.detect.outputs.version }}
|
|
317
|
+
body: |
|
|
318
|
+
Published to crates.io: https://crates.io/crates/sqlrite-mcp/${{ needs.detect.outputs.version }}
|
|
319
|
+
|
|
320
|
+
Model Context Protocol (MCP) server for SQLRite. Wraps a SQLRite database as a stdio-spawned subprocess that LLM agents (Claude Code, Cursor, `mcp-inspector`) can drive without custom integration code.
|
|
321
|
+
|
|
322
|
+
```sh
|
|
323
|
+
cargo install sqlrite-mcp
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
```json
|
|
327
|
+
// ~/.claude.json
|
|
328
|
+
{
|
|
329
|
+
"mcpServers": {
|
|
330
|
+
"sqlrite": {
|
|
331
|
+
"command": "sqlrite-mcp",
|
|
332
|
+
"args": ["/path/to/your.sqlrite"],
|
|
333
|
+
"env": { "SQLRITE_LLM_API_KEY": "sk-ant-…" }
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Seven tools: `list_tables`, `describe_table`, `query`, `execute`, `schema_dump`, `vector_search`, `ask`. Pass `--read-only` to hide `execute`. Pre-built binary tarballs (no Rust toolchain required) are attached to this release as well — see `sqlrite-mcp-v${{ needs.detect.outputs.version }}-{platform}.tar.gz`.
|
|
340
|
+
|
|
341
|
+
Full docs: https://github.com/joaoh82/rust_sqlite/blob/main/docs/mcp.md
|
|
342
|
+
|
|
343
|
+
See the umbrella release [v${{ needs.detect.outputs.version }}](../../releases/tag/v${{ needs.detect.outputs.version }}) for the full changelog.
|
|
344
|
+
generate_release_notes: true
|
|
345
|
+
|
|
346
|
+
# ---------------------------------------------------------------------------
|
|
347
|
+
# Step 3a''': build the `sqlrite-mcp` binary for each supported
|
|
348
|
+
# platform and upload the per-platform tarballs to the
|
|
349
|
+
# `sqlrite-mcp-v<V>` GitHub Release. So users who don't want to
|
|
350
|
+
# `cargo install` (no Rust toolchain) can grab a tarball and drop
|
|
351
|
+
# the binary on their PATH.
|
|
352
|
+
#
|
|
353
|
+
# Matrix mirrors `publish-ffi` — same four platforms, same
|
|
354
|
+
# "aarch64 on macOS, x86_64 elsewhere" choice. The binary is much
|
|
355
|
+
# smaller than the FFI artifact (one [[bin]], no .so/.a files) so
|
|
356
|
+
# we just package the executable + the README.
|
|
357
|
+
build-mcp-binaries:
|
|
358
|
+
name: Build sqlrite-mcp binary (${{ matrix.platform }})
|
|
359
|
+
needs: [detect, tag-all, publish-mcp]
|
|
360
|
+
if: needs.detect.outputs.should_release == 'true'
|
|
361
|
+
runs-on: ${{ matrix.os }}
|
|
362
|
+
environment: release
|
|
363
|
+
strategy:
|
|
364
|
+
fail-fast: false
|
|
365
|
+
matrix:
|
|
366
|
+
include:
|
|
367
|
+
- os: ubuntu-latest
|
|
368
|
+
platform: linux-x86_64
|
|
369
|
+
bin: sqlrite-mcp
|
|
370
|
+
- os: ubuntu-24.04-arm
|
|
371
|
+
platform: linux-aarch64
|
|
372
|
+
bin: sqlrite-mcp
|
|
373
|
+
- os: macos-latest
|
|
374
|
+
platform: macos-aarch64
|
|
375
|
+
bin: sqlrite-mcp
|
|
376
|
+
- os: windows-latest
|
|
377
|
+
platform: windows-x86_64
|
|
378
|
+
bin: sqlrite-mcp.exe
|
|
379
|
+
steps:
|
|
380
|
+
- uses: actions/checkout@v4
|
|
381
|
+
|
|
382
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
383
|
+
|
|
384
|
+
- uses: Swatinem/rust-cache@v2
|
|
385
|
+
with:
|
|
386
|
+
shared-key: build-mcp-${{ matrix.platform }}
|
|
387
|
+
|
|
388
|
+
- name: Build sqlrite-mcp
|
|
389
|
+
# Default features include `ask`, so the binary ships with the
|
|
390
|
+
# natural-language → SQL tool wired in. Users who want a leaner
|
|
391
|
+
# build (no LLM machinery, six pure-SQL tools) can
|
|
392
|
+
# `cargo install sqlrite-mcp --no-default-features` from source.
|
|
393
|
+
run: cargo build --release -p sqlrite-mcp
|
|
394
|
+
|
|
395
|
+
- name: Package tarball
|
|
396
|
+
shell: bash
|
|
397
|
+
run: |
|
|
398
|
+
V="${{ needs.detect.outputs.version }}"
|
|
399
|
+
STAGE="sqlrite-mcp-v$V-${{ matrix.platform }}"
|
|
400
|
+
mkdir -p "$STAGE"
|
|
401
|
+
cp "target/release/${{ matrix.bin }}" "$STAGE/"
|
|
402
|
+
cat > "$STAGE/README" <<EOF
|
|
403
|
+
sqlrite-mcp v$V — ${{ matrix.platform }}
|
|
404
|
+
|
|
405
|
+
Model Context Protocol server for SQLRite.
|
|
406
|
+
|
|
407
|
+
Drop the binary on your PATH and wire it into your MCP client
|
|
408
|
+
(Claude Code, Cursor, mcp-inspector, etc.):
|
|
409
|
+
|
|
410
|
+
sqlrite-mcp /path/to/your.sqlrite # read-write
|
|
411
|
+
sqlrite-mcp /path/to/your.sqlrite --read-only # shared-lock RO
|
|
412
|
+
sqlrite-mcp --in-memory # ephemeral
|
|
413
|
+
|
|
414
|
+
Full docs: https://github.com/joaoh82/rust_sqlite/blob/main/docs/mcp.md
|
|
415
|
+
EOF
|
|
416
|
+
tar czf "$STAGE.tar.gz" "$STAGE"
|
|
417
|
+
echo "ASSET=$STAGE.tar.gz" >> "$GITHUB_ENV"
|
|
418
|
+
|
|
419
|
+
- name: Upload to GitHub Release
|
|
420
|
+
uses: softprops/action-gh-release@v2
|
|
421
|
+
with:
|
|
422
|
+
tag_name: sqlrite-mcp-v${{ needs.detect.outputs.version }}
|
|
423
|
+
name: sqlrite-mcp v${{ needs.detect.outputs.version }}
|
|
424
|
+
files: ${{ env.ASSET }}
|
|
425
|
+
# The release body was already populated by `publish-mcp`
|
|
426
|
+
# above; this job only attaches assets. Don't overwrite it.
|
|
427
|
+
append_body: false
|
|
428
|
+
|
|
270
429
|
# ---------------------------------------------------------------------------
|
|
271
430
|
# Step 3b: build `libsqlrite_c` for each supported platform and
|
|
272
431
|
# upload the tarballs to the `sqlrite-ffi-v<V>` GitHub Release.
|
|
@@ -1291,7 +1450,7 @@ jobs:
|
|
|
1291
1450
|
# config if we add one later.
|
|
1292
1451
|
finalize:
|
|
1293
1452
|
name: Finalize umbrella release
|
|
1294
|
-
needs: [detect, publish-crate, publish-ask, publish-ffi, publish-desktop, publish-python, publish-nodejs, publish-wasm, publish-go]
|
|
1453
|
+
needs: [detect, publish-crate, publish-ask, publish-mcp, build-mcp-binaries, publish-ffi, publish-desktop, publish-python, publish-nodejs, publish-wasm, publish-go]
|
|
1295
1454
|
if: needs.detect.outputs.should_release == 'true'
|
|
1296
1455
|
runs-on: ubuntu-latest
|
|
1297
1456
|
steps:
|
|
@@ -1310,6 +1469,7 @@ jobs:
|
|
|
1310
1469
|
Per-product releases in this wave:
|
|
1311
1470
|
|
|
1312
1471
|
- 🦀 [Rust engine](../../releases/tag/sqlrite-v${{ needs.detect.outputs.version }}) → [crates.io](https://crates.io/crates/sqlrite-engine/${{ needs.detect.outputs.version }})
|
|
1472
|
+
- 🤖 [MCP server](../../releases/tag/sqlrite-mcp-v${{ needs.detect.outputs.version }}) → [crates.io](https://crates.io/crates/sqlrite-mcp/${{ needs.detect.outputs.version }}) — `cargo install sqlrite-mcp` or grab a prebuilt binary tarball; wires SQLRite into Claude Code / Cursor / any MCP client over stdio
|
|
1313
1473
|
- 🔧 [C FFI](../../releases/tag/sqlrite-ffi-v${{ needs.detect.outputs.version }}) — prebuilt `libsqlrite_c` for Linux x86_64/aarch64, macOS aarch64, Windows x86_64
|
|
1314
1474
|
- 🖥️ [Desktop](../../releases/tag/sqlrite-desktop-v${{ needs.detect.outputs.version }}) — unsigned installers for Linux (AppImage + deb), macOS (dmg aarch64), Windows (msi)
|
|
1315
1475
|
- 🐍 [Python](../../releases/tag/sqlrite-py-v${{ needs.detect.outputs.version }}) → [PyPI](https://pypi.org/project/sqlrite/${{ needs.detect.outputs.version }}/) — abi3-py38 wheels for Linux x86_64/aarch64, macOS aarch64, Windows x86_64 + sdist
|
|
@@ -415,6 +415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
415
415
|
checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51"
|
|
416
416
|
dependencies = [
|
|
417
417
|
"clap_builder",
|
|
418
|
+
"clap_derive",
|
|
418
419
|
]
|
|
419
420
|
|
|
420
421
|
[[package]]
|
|
@@ -429,6 +430,18 @@ dependencies = [
|
|
|
429
430
|
"strsim",
|
|
430
431
|
]
|
|
431
432
|
|
|
433
|
+
[[package]]
|
|
434
|
+
name = "clap_derive"
|
|
435
|
+
version = "4.6.1"
|
|
436
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
437
|
+
checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9"
|
|
438
|
+
dependencies = [
|
|
439
|
+
"heck 0.5.0",
|
|
440
|
+
"proc-macro2",
|
|
441
|
+
"quote",
|
|
442
|
+
"syn 2.0.117",
|
|
443
|
+
]
|
|
444
|
+
|
|
432
445
|
[[package]]
|
|
433
446
|
name = "clap_lex"
|
|
434
447
|
version = "1.1.0"
|
|
@@ -3804,7 +3817,7 @@ dependencies = [
|
|
|
3804
3817
|
|
|
3805
3818
|
[[package]]
|
|
3806
3819
|
name = "sqlrite-ask"
|
|
3807
|
-
version = "0.1.
|
|
3820
|
+
version = "0.1.25"
|
|
3808
3821
|
dependencies = [
|
|
3809
3822
|
"serde",
|
|
3810
3823
|
"serde_json",
|
|
@@ -3815,7 +3828,7 @@ dependencies = [
|
|
|
3815
3828
|
|
|
3816
3829
|
[[package]]
|
|
3817
3830
|
name = "sqlrite-desktop"
|
|
3818
|
-
version = "0.1.
|
|
3831
|
+
version = "0.1.25"
|
|
3819
3832
|
dependencies = [
|
|
3820
3833
|
"serde",
|
|
3821
3834
|
"serde_json",
|
|
@@ -3827,7 +3840,7 @@ dependencies = [
|
|
|
3827
3840
|
|
|
3828
3841
|
[[package]]
|
|
3829
3842
|
name = "sqlrite-engine"
|
|
3830
|
-
version = "0.1.
|
|
3843
|
+
version = "0.1.25"
|
|
3831
3844
|
dependencies = [
|
|
3832
3845
|
"clap",
|
|
3833
3846
|
"env_logger",
|
|
@@ -3844,7 +3857,7 @@ dependencies = [
|
|
|
3844
3857
|
|
|
3845
3858
|
[[package]]
|
|
3846
3859
|
name = "sqlrite-ffi"
|
|
3847
|
-
version = "0.1.
|
|
3860
|
+
version = "0.1.25"
|
|
3848
3861
|
dependencies = [
|
|
3849
3862
|
"cbindgen",
|
|
3850
3863
|
"serde",
|
|
@@ -3852,9 +3865,20 @@ dependencies = [
|
|
|
3852
3865
|
"sqlrite-engine",
|
|
3853
3866
|
]
|
|
3854
3867
|
|
|
3868
|
+
[[package]]
|
|
3869
|
+
name = "sqlrite-mcp"
|
|
3870
|
+
version = "0.1.25"
|
|
3871
|
+
dependencies = [
|
|
3872
|
+
"clap",
|
|
3873
|
+
"libc",
|
|
3874
|
+
"serde",
|
|
3875
|
+
"serde_json",
|
|
3876
|
+
"sqlrite-engine",
|
|
3877
|
+
]
|
|
3878
|
+
|
|
3855
3879
|
[[package]]
|
|
3856
3880
|
name = "sqlrite-nodejs"
|
|
3857
|
-
version = "0.1.
|
|
3881
|
+
version = "0.1.25"
|
|
3858
3882
|
dependencies = [
|
|
3859
3883
|
"napi",
|
|
3860
3884
|
"napi-build",
|
|
@@ -3864,7 +3888,7 @@ dependencies = [
|
|
|
3864
3888
|
|
|
3865
3889
|
[[package]]
|
|
3866
3890
|
name = "sqlrite-python"
|
|
3867
|
-
version = "0.1.
|
|
3891
|
+
version = "0.1.25"
|
|
3868
3892
|
dependencies = [
|
|
3869
3893
|
"pyo3",
|
|
3870
3894
|
"sqlrite-engine",
|
|
@@ -27,7 +27,7 @@ resolver = "3"
|
|
|
27
27
|
# `package =` key so the import name stays `sqlrite` internally:
|
|
28
28
|
# sqlrite = { package = "sqlrite-engine", path = "…" }
|
|
29
29
|
name = "sqlrite-engine"
|
|
30
|
-
version = "0.1.
|
|
30
|
+
version = "0.1.25"
|
|
31
31
|
authors = ["Joao Henrique Machado Silva <joaoh82@gmail.com>"]
|
|
32
32
|
edition = "2024"
|
|
33
33
|
rust-version = "1.85"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlrite
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.25
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -243,6 +243,10 @@ python -m pytest tests/
|
|
|
243
243
|
- maturin as the build backend, emitting standard `.whl` files that pip can install directly.
|
|
244
244
|
- Phase 6f's CI publishes abi3-py38 wheels to PyPI for manylinux x86_64/aarch64, macOS aarch64, and Windows x86_64 (plus an sdist) on every release. OIDC trusted publishing — no long-lived PyPI token in the repo.
|
|
245
245
|
|
|
246
|
+
## Sibling products
|
|
247
|
+
|
|
248
|
+
This SDK is for when *your code* drives the database. If you want an *LLM agent* to drive a SQLRite database directly, install the [`sqlrite-mcp`](../../docs/mcp.md) Model Context Protocol server (`cargo install sqlrite-mcp`) and wire it into Claude Code / Cursor / `mcp-inspector` / any MCP-aware client. Same engine underneath.
|
|
249
|
+
|
|
246
250
|
## Status
|
|
247
251
|
|
|
248
252
|
Phase 5c MVP: ✅ — basic CRUD, transactions, context managers, read-only mode, iteration. Parameter binding, CursorRow namedtuples, and type converters (datetime, Decimal) are natural follow-ups.
|
|
@@ -80,6 +80,32 @@ A cross-platform Tauri 2.0 + Svelte 5 desktop GUI ships alongside the REPL (see
|
|
|
80
80
|
|
|
81
81
|
**From source** — `cd desktop && npm install && npm run tauri dev`. The header's New… / Open… / Save As… buttons cover the file lifecycle; the query editor has a live line-number gutter, `⌘/` (Ctrl+/) SQL comment toggle, and selection-aware Run (highlight a statement to run just that one).
|
|
82
82
|
|
|
83
|
+
### MCP server (drive SQLRite from an LLM agent)
|
|
84
|
+
|
|
85
|
+
`sqlrite-mcp` exposes a SQLRite database as a [Model Context Protocol](https://modelcontextprotocol.io/) stdio server. Spawn it from any MCP client (Claude Code, Cursor, `mcp-inspector`, …) and the agent gets seven tools — `list_tables`, `describe_table`, `query`, `execute`, `schema_dump`, `vector_search`, plus `ask` for natural-language → SQL — without any custom integration code.
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
cargo install sqlrite-mcp
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Or grab a per-platform pre-built binary from the [latest release](https://github.com/joaoh82/rust_sqlite/releases/latest) (Linux x86_64/aarch64, macOS aarch64, Windows x86_64).
|
|
92
|
+
|
|
93
|
+
Wire it into Claude Code (`~/.claude.json`):
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"sqlrite": {
|
|
99
|
+
"command": "sqlrite-mcp",
|
|
100
|
+
"args": ["/absolute/path/to/your.sqlrite"],
|
|
101
|
+
"env": { "SQLRITE_LLM_API_KEY": "sk-ant-…" }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`--read-only` opens the DB with a shared lock and hides the `execute` tool. Full docs + the other six tools' references in [`docs/mcp.md`](docs/mcp.md).
|
|
108
|
+
|
|
83
109
|
### Developer guide
|
|
84
110
|
|
|
85
111
|
In-depth documentation lives under [`docs/`](docs/). Start at [`docs/_index.md`](docs/_index.md) — it navigates to:
|
|
@@ -100,10 +126,10 @@ Build and launch the REPL:
|
|
|
100
126
|
cargo run
|
|
101
127
|
```
|
|
102
128
|
|
|
103
|
-
You'll drop into a REPL connected to a transient in-memory database.
|
|
129
|
+
You'll drop into a REPL connected to a transient in-memory database. Use `.open <path>` to switch to a file-backed database (auto-saves on every statement; see Meta commands).
|
|
104
130
|
|
|
105
131
|
```
|
|
106
|
-
SQLRite
|
|
132
|
+
SQLRite
|
|
107
133
|
Enter .exit to quit.
|
|
108
134
|
Enter .help for usage hints.
|
|
109
135
|
Connected to a transient in-memory database.
|
|
@@ -183,7 +209,9 @@ println!("Why: {}", resp.explanation);
|
|
|
183
209
|
|
|
184
210
|
**Defaults:** `claude-sonnet-4-6`, `max_tokens: 1024`, schema dump cached for 5 minutes via Anthropic prompt caching (configurable to 1h or off via `AskConfig::cache_ttl`). Bring your own API key — set `SQLRITE_LLM_API_KEY` or pass it on `AskConfig`.
|
|
185
211
|
|
|
186
|
-
In the REPL: `.ask <question>`. From an open `Connection` (this section). Per-product wrappers
|
|
212
|
+
In the REPL: `.ask <question>`. From an open `Connection` (this section). Per-product wrappers shipped across **7g.3 – 7g.8**: the desktop "Ask…" composer, `conn.ask()` / `db.ask()` in the Python / Node / Go SDKs, the WASM SDK's split `db.askPrompt()` / `db.askParse()` shape (so the API key never enters the browser), and the MCP `ask` tool exposed by [`sqlrite-mcp`](docs/mcp.md) (so any LLM agent over MCP can call `ask` against your database directly). See [`docs/phase-7-plan.md`](docs/phase-7-plan.md) §7g for the full surface plan.
|
|
213
|
+
|
|
214
|
+
For the canonical Ask reference covering every surface (REPL, desktop, Rust library, Python / Node / Go / WASM), env vars, defaults, prompt caching, and the security model — read [`docs/ask.md`](docs/ask.md). For copy-paste backend proxy templates the WASM SDK needs (Cloudflare Workers, Vercel Edge, Deno Deploy, Firebase, AWS Lambda, Express), see [`docs/ask-backend-examples.md`](docs/ask-backend-examples.md).
|
|
187
215
|
|
|
188
216
|
### Roadmap
|
|
189
217
|
|
|
@@ -228,7 +256,7 @@ The project is staged in phases, each independently shippable. A finished phase
|
|
|
228
256
|
- [x] **Tauri 2.0 backend**: four commands (`open_database`, `list_tables`, `table_rows`, `execute_sql`) wrap the engine; results are tagged enums shipped to the UI via the JSON IPC bridge.
|
|
229
257
|
- [x] **Svelte 5 frontend**: dark-themed three-pane layout — header with "Open…" file picker, sidebar with table list + schema, query editor with Cmd/Ctrl+Enter to run, result grid with sticky header.
|
|
230
258
|
|
|
231
|
-
**Phase 4 — Durability and concurrency** *(
|
|
259
|
+
**Phase 4 — Durability and concurrency** *(done)*
|
|
232
260
|
- [x] **4a — Exclusive file lock**: `Pager::open` / `::create` takes an OS advisory lock (`fs2::try_lock_exclusive`); a second process on the same file gets a clean "already in use" error. Lock releases automatically when the Pager drops.
|
|
233
261
|
- [x] **4b — Write-Ahead Log (`<db>.sqlrite-wal`) file format + frame codec**: 32-byte WAL header (magic / version / page size / salt / checkpoint seq), 4112-byte frames carrying `(page_num, commit_page_count, salt, checksum, body)`. Rolling-sum checksum. Torn-write recovery: corrupt or partial trailing frames are silently truncated at the boundary. Standalone module; not wired yet.
|
|
234
262
|
- [x] **4c — WAL-aware Pager**: `Pager::open` / `::create` now own both the main file and its `-wal` sidecar. Reads resolve `staged → wal_cache → on_disk` with a page-count bounds check; commits append a WAL frame per dirty page plus a final commit frame carrying the new page 0 (encoded header). The main file stays frozen between checkpoints — reopening replays the WAL and the decoded page-0 frame overrides the (stale) main-file header.
|
|
@@ -244,7 +272,7 @@ The project is staged in phases, each independently shippable. A finished phase
|
|
|
244
272
|
- [x] **5e — Go SDK**: new `sdk/go/` module at `github.com/joaoh82/rust_sqlite/sdk/go`; cgo-wired against `libsqlrite_c` from Phase 5b. Implements the full `database/sql/driver` surface so users get the standard-library experience (`sql.Open("sqlrite", path)`, `db.Query/Exec/Begin`, `rows.Scan(&id, &name)`). 9-test `go test` integration suite. `examples/go/hello.go` runs after `cargo build --release -p sqlrite-ffi`. Module publish landed in Phase 6i — `go get github.com/joaoh82/rust_sqlite/sdk/go@vX.Y.Z` resolves directly via VCS tag.
|
|
245
273
|
- [ ] **5f — Rust crate polish** *(deferred — Phase 6c companion)*: crate metadata, docs.rs config, prep for `cargo publish`. Deferred to land alongside the actual publish workflow.
|
|
246
274
|
- [x] **5g — WASM** build: new `sdk/wasm/` crate via `wasm-bindgen`; engine runs entirely in a browser tab. Feature-gated root crate (`cli` + `file-locks` optional, both default-on) so WASM disables fs2 / rustyline / clap / env_logger cleanly. `Database` class with `exec/query/columns/inTransaction`; rows as plain JS objects in projection order. ~1.8 MB wasm / ~500 KB gzipped. Three `wasm-pack` targets (web/bundler/nodejs). `examples/wasm/` ships a self-contained HTML SQL console.
|
|
247
|
-
- [
|
|
275
|
+
- [x] Code examples for every language under `examples/{rust,python,nodejs,go,wasm,c}/`
|
|
248
276
|
|
|
249
277
|
**Phase 6 — Release engineering + CI/CD**
|
|
250
278
|
Lockstep versioning — one dispatch bumps every product to the same `vX.Y.Z`. Two-workflow design: `release-pr.yml` opens a Release PR with the version bumps (human reviews + merges), then `release.yml` fires on merge to tag + publish everything. Trusted-publishing via OIDC for PyPI + npm (no long-lived tokens). Full plan: [`docs/release-plan.md`](docs/release-plan.md).
|
|
@@ -263,7 +291,7 @@ Lockstep versioning — one dispatch bumps every product to the same `vX.Y.Z`. T
|
|
|
263
291
|
- [ ] macOS Apple Developer ID cert → `codesign` + `notarytool` in `tauri-action`
|
|
264
292
|
- [ ] Windows code-signing cert → `signtool` in `tauri-action`
|
|
265
293
|
|
|
266
|
-
**Phase 7 — AI-era extensions** *(
|
|
294
|
+
**Phase 7 — AI-era extensions** *(7a–7h shipped; FTS deferred to Phase 8 — full plan in [`docs/phase-7-plan.md`](docs/phase-7-plan.md))*
|
|
267
295
|
- [x] **7a — `VECTOR(N)` column type** *(v0.1.10)*: dense f32 vectors with bracket-array literal syntax (`[0.1, 0.2, ...]`); file format bumped to v4
|
|
268
296
|
- [x] **7b — Distance functions** *(v0.1.11)*: `vec_distance_l2/cosine/dot` + `ORDER BY <expr> LIMIT k` so KNN queries work end-to-end
|
|
269
297
|
- [x] **7c — Bounded-heap top-k optimization** *(v0.1.12)*
|
|
@@ -272,8 +300,11 @@ Lockstep versioning — one dispatch bumps every product to the same `vX.Y.Z`. T
|
|
|
272
300
|
- [x] **7g.1 — `sqlrite-ask` crate** *(v0.1.18)*: foundational natural-language → SQL via the [Anthropic API](https://docs.anthropic.com/) (Sonnet 4.6 by default), prompt-cached schema dump, sync `ureq` HTTP.
|
|
273
301
|
- [x] **7g.2 — REPL `.ask` + dep-direction flip** *(v0.1.19)*: `.ask <question>` meta-command with `Run? [Y/n]` confirmation. The wiring required dropping the engine dep from `sqlrite-ask` (cargo cycle) — `sqlrite-ask` is now pure over `&str` schemas; the `Connection`/`Database` integration moved to the engine's new `ask` feature. Public surface for callers: `use sqlrite::{Connection, ConnectionAskExt}`.
|
|
274
302
|
- [x] **7g.3 — Desktop "Ask…" button** *(this wave)*: composer panel above the editor textarea; click → type a natural-language question → submit → generated SQL drops into the editor for review before Run. Schema introspection + LLM HTTP call run in the Tauri Rust backend, so the API key never crosses into the webview.
|
|
275
|
-
- [
|
|
276
|
-
- [
|
|
303
|
+
- [x] **7g.4 — Python SDK `conn.ask` / `ask_run` / `AskConfig`** *(v0.1.20)*: PyO3 wrappers; three-layer config precedence (per-call > per-connection > env > defaults); `__repr__` omits the API key.
|
|
304
|
+
- [x] **7g.5 — Node.js SDK `db.ask` / `askRun` / `AskConfig`** *(v0.1.21)*: napi-rs wrappers with idiomatic camelCase option-object; same three-layer precedence; mock HTTP test runs in `worker_thread` to avoid event-loop deadlock.
|
|
305
|
+
- [x] **7g.6 — Go SDK `sqlrite.Ask` / `AskRun` / `AskConfig`** *(v0.1.22)*: cgo wrapper plus `AskContext` / `AskRunContext`; new C FFI function takes `AskConfig` as a JSON string for ABI extensibility.
|
|
306
|
+
- [x] **7g.7 — WASM SDK `db.askPrompt` / `db.askParse` (Q9 split shape)** *(v0.1.23)*: browser builds the prompt + parses the response; user's backend holds the API key. Plus `docs/ask.md` (canonical Ask reference) and `docs/ask-backend-examples.md` (Cloudflare Workers / Vercel Edge / Deno Deploy / Firebase / AWS Lambda / Express templates).
|
|
307
|
+
- [x] **7h — MCP server adapter (`sqlrite-mcp` binary)** *(this wave)*: hand-rolled JSON-RPC 2.0 over stdio; seven tools — `list_tables`, `describe_table`, `query`, `execute`, `schema_dump`, `vector_search`, plus `ask` as Phase **7g.8** behind a default-on cargo feature. Read-only mode hides `execute`. Stdout-redirect dance keeps engine prettytable noise off the protocol channel. See [`docs/mcp.md`](docs/mcp.md) for wiring into Claude Code / Cursor / `mcp-inspector`.
|
|
277
308
|
- [ ] *(deferred to Phase 8)* Full-text search with BM25 + hybrid retrieval
|
|
278
309
|
|
|
279
310
|
**Possible extras** *(no committed phase)*
|
|
@@ -18,6 +18,12 @@ A small, hand-written guide to the SQLRite codebase — how it's structured, how
|
|
|
18
18
|
- [Embedding](embedding.md) — the public `Connection` / `Statement` / `Rows` API (Phase 5a) and where the non-Rust SDKs plug in (Phase 5b – 5g)
|
|
19
19
|
- [`examples/`](../examples/) — runnable Rust quickstart (`cargo run --example quickstart`); language-specific subdirectories fill in as each 5x sub-phase lands
|
|
20
20
|
|
|
21
|
+
## Phase 7 — AI-era extensions
|
|
22
|
+
|
|
23
|
+
- [Ask — natural-language → SQL](ask.md) — the canonical reference for the `ask()` feature across every product surface (REPL, desktop, Rust library, Python / Node / Go / WASM SDKs, MCP server); env vars, defaults, prompt caching, security
|
|
24
|
+
- [Ask backend proxy templates](ask-backend-examples.md) — copy-paste backend examples for the WASM SDK's split design: Cloudflare Workers, Vercel Edge, Deno Deploy, Firebase Functions, AWS Lambda, Express, pure Node
|
|
25
|
+
- [MCP server (`sqlrite-mcp`)](mcp.md) — Phase 7h: SQLRite as a Model Context Protocol stdio server. Wiring into Claude Code / Cursor / `mcp-inspector`; the seven tools (`list_tables`, `describe_table`, `query`, `execute`, `schema_dump`, `vector_search`, `ask`); read-only mode; the JSON-RPC wire format
|
|
26
|
+
|
|
21
27
|
## Internals
|
|
22
28
|
|
|
23
29
|
These documents go into the implementation of each subsystem.
|
|
@@ -30,28 +36,29 @@ These documents go into the implementation of each subsystem.
|
|
|
30
36
|
|
|
31
37
|
## Project state
|
|
32
38
|
|
|
33
|
-
As of
|
|
39
|
+
As of May 2026, SQLRite has:
|
|
34
40
|
|
|
35
41
|
- A working SQL engine (in-memory + on-disk with a real B-Tree per table + secondary indexes, Phases 0 – 3 complete)
|
|
36
42
|
- WAL-backed persistence with crash-safe checkpointing, shared/exclusive lock modes, and real `BEGIN` / `COMMIT` / `ROLLBACK` transactions (Phase 4 complete)
|
|
37
43
|
- A stable public Rust embedding API plus C FFI shim and SDKs for Python, Node.js, Go, and WASM (Phase 5 complete except the optional 5f crate-polish task)
|
|
38
44
|
- A Tauri 2.0 + Svelte desktop app (Phase 2.5 complete)
|
|
39
|
-
-
|
|
45
|
+
- AI-era extensions across the product surface (Phase 7 complete except FTS): VECTOR columns + HNSW indexes (7a-7d), JSON columns (7e), the `ask()` natural-language → SQL family across the REPL / desktop / Rust / Python / Node / Go / WASM (7g.1-7g.7), and the [`sqlrite-mcp`](mcp.md) Model Context Protocol server with seven tools including `ask` (7h + 7g.8)
|
|
46
|
+
- A fully-automated release pipeline that ships every product to its registry on every release with one human action — Rust engine + `sqlrite-ask` + `sqlrite-mcp` to crates.io, Python wheels to PyPI (`sqlrite`), Node.js + WASM to npm (`@joaoh82/sqlrite` + `@joaoh82/sqlrite-wasm`), Go module via `sdk/go/v*` git tag, plus C FFI tarballs, MCP binary tarballs, and unsigned desktop installers as GitHub Release assets (Phase 6 complete)
|
|
40
47
|
|
|
41
|
-
The active frontier is **Phase
|
|
48
|
+
The active frontier is **Phase 8 — Full-text search + hybrid retrieval** (the deferred 7f scope).
|
|
42
49
|
|
|
43
50
|
See the [Roadmap](roadmap.md) for the full phase plan.
|
|
44
51
|
|
|
45
52
|
## Release engineering
|
|
46
53
|
|
|
47
|
-
- [Release plan](release-plan.md) — Phase 6 design doc: lockstep versioning, PR-based release flow, OIDC trusted publishing, the
|
|
54
|
+
- [Release plan](release-plan.md) — Phase 6 design doc: lockstep versioning, PR-based release flow, OIDC trusted publishing, the version-bump surface
|
|
48
55
|
- [Release secrets runbook](release-secrets.md) — one-time web-UI setup for crates.io, PyPI, npm, GitHub `release` environment, and `main` branch protection
|
|
49
56
|
- [`scripts/`](../scripts/) — runnable tooling used by release workflows + reproducible locally (start with `scripts/bump-version.sh`)
|
|
50
57
|
|
|
51
58
|
## Future work
|
|
52
59
|
|
|
53
|
-
- [Phase 7 plan](phase-7-plan.md) — AI-era extensions (vector column type + HNSW, JSON, NL→SQL `ask()` API across REPL/library/SDKs/desktop/MCP, MCP server). **
|
|
54
|
-
- Phase 8 — Full-text search (FTS5-style BM25) + hybrid retrieval, deferred from Phase 7 per the plan-doc's Q1.
|
|
60
|
+
- [Phase 7 plan](phase-7-plan.md) — AI-era extensions (vector column type + HNSW, JSON, NL→SQL `ask()` API across REPL/library/SDKs/desktop/MCP, MCP server). **Implementation complete except 7f, which deferred to Phase 8.**
|
|
61
|
+
- Phase 8 — Full-text search (FTS5-style BM25) + hybrid retrieval, deferred from Phase 7 per the plan-doc's Q1. **Active frontier as of May 2026.**
|
|
55
62
|
|
|
56
63
|
## Conventions
|
|
57
64
|
|
|
@@ -66,20 +66,43 @@ A bird's-eye view of the system, with pointers into the code.
|
|
|
66
66
|
└───────────────────────────┘
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
##
|
|
69
|
+
## Workspace layout
|
|
70
|
+
|
|
71
|
+
The repo is a Cargo workspace. The engine is the root crate; everything else lives in a sibling directory.
|
|
72
|
+
|
|
73
|
+
| Crate / directory | Role |
|
|
74
|
+
|---|---|
|
|
75
|
+
| Root (`./`) — `sqlrite-engine` on crates.io, `use sqlrite::…` in code | The engine. Library + the REPL `[[bin]]`. Library surface: `Connection`, `Statement`, `Rows`, `Value`, `Database`. |
|
|
76
|
+
| [`sqlrite-ffi/`](../sqlrite-ffi/) | C FFI shim. Builds `libsqlrite_c.{so,dylib,dll}` + cbindgen-generated `sqlrite.h`. Used by the Go SDK + by anyone wanting to dlopen SQLRite from another language. Phase 5b. |
|
|
77
|
+
| [`sqlrite-ask/`](../sqlrite-ask/) | Pure-Rust LLM transport adapter (Anthropic-first; OpenAI / Ollama follow-ups pending). Takes a `&str` schema dump + `&str` question, returns generated SQL. No engine dep — the engine integration lives in `sqlrite-engine`'s `ask` feature. Phase 7g.1 + the 7g.2 dep-direction flip. |
|
|
78
|
+
| [`sqlrite-mcp/`](../sqlrite-mcp/) | Model Context Protocol server binary. Hand-rolled JSON-RPC 2.0 over stdio. Seven tools (`list_tables`, `describe_table`, `query`, `execute`, `schema_dump`, `vector_search`, `ask`). Phase 7h + 7g.8. See [`mcp.md`](mcp.md). |
|
|
79
|
+
| [`sdk/python/`](../sdk/python/) | PyO3 bindings — `sqlrite` on PyPI. Phase 5c. |
|
|
80
|
+
| [`sdk/nodejs/`](../sdk/nodejs/) | napi-rs bindings — `@joaoh82/sqlrite` on npm. Phase 5d. |
|
|
81
|
+
| [`sdk/go/`](../sdk/go/) | cgo wrapper over `sqlrite-ffi`. `database/sql` driver. Phase 5e. |
|
|
82
|
+
| [`sdk/wasm/`](../sdk/wasm/) | wasm-bindgen build — `@joaoh82/sqlrite-wasm` on npm. Phase 5g. *(Not a workspace member — wasm32 target only.)* |
|
|
83
|
+
| [`desktop/src-tauri/`](../desktop/src-tauri/) | Tauri 2.0 + Svelte 5 desktop app. Embeds the engine directly. Phase 2.5. |
|
|
84
|
+
|
|
85
|
+
The engine never depends on the SDK crates; the SDK crates each depend on the engine via path-dep. `sqlrite-mcp` depends on the engine (default-features = false) plus its own optional `ask` feature that re-enables the engine's `ask` feature, which pulls `sqlrite-ask` transitively. The whole graph is acyclic — see the 7g.2 dep-direction flip retrospective in [roadmap.md](roadmap.md) for the work that made it so.
|
|
86
|
+
|
|
87
|
+
## Module map (engine)
|
|
70
88
|
|
|
71
89
|
| Module | What it owns |
|
|
72
90
|
|---|---|
|
|
73
91
|
| [`src/main.rs`](../src/main.rs) | Binary entry: init env_logger, build rustyline editor, run the REPL loop, route input to either the meta or SQL dispatcher |
|
|
92
|
+
| [`src/lib.rs`](../src/lib.rs) | Library entry: re-exports `Connection`, `Statement`, `Rows`, `Value`, `Database`, `process_command`, the `ask` module (when feature on), etc. — the stable public surface every SDK binds against |
|
|
93
|
+
| [`src/connection.rs`](../src/connection.rs) | `Connection` / `Statement` / `Rows` / `Row` / `OwnedRow` / `FromValue` — the Phase 5a public API |
|
|
94
|
+
| [`src/ask/`](../src/ask/) | Engine integration with `sqlrite-ask`: `ConnectionAskExt`, `ask_with_database`, the `schema::dump_schema_for_database` helper. The `schema` submodule is always available; the rest is gated behind the `ask` feature. Phase 7g.2. |
|
|
74
95
|
| [`src/repl/`](../src/repl/) | `REPLHelper` (implements rustyline's `Helper` trait: completer, hinter, highlighter, validator). Also `get_config` and `get_command_type` |
|
|
75
|
-
| [`src/meta_command/`](../src/meta_command/) | `MetaCommand` enum, parsing (`.open FOO.db` → `Open(PathBuf)`), and dispatch to persistence helpers |
|
|
96
|
+
| [`src/meta_command/`](../src/meta_command/) | `MetaCommand` enum, parsing (`.open FOO.db` → `Open(PathBuf)`, `.ask <Q>` → `Ask(String)`), and dispatch to persistence + ask helpers |
|
|
76
97
|
| [`src/error.rs`](../src/error.rs) | `SQLRiteError` (thiserror-derived), `Result<T>` alias, hand-rolled `PartialEq` that handles `io::Error` |
|
|
77
98
|
| [`src/sql/mod.rs`](../src/sql/mod.rs) | `SQLCommand` classifier, `process_command` — the top-level entry that parses a SQL string and routes to the right executor. Also triggers auto-save. |
|
|
78
99
|
| [`src/sql/parser/`](../src/sql/parser/) | Takes a `sqlparser::ast::Statement` and produces internal query structs (`CreateQuery`, `InsertQuery`, `SelectQuery`) with only the fields we actually use |
|
|
79
|
-
| [`src/sql/executor.rs`](../src/sql/executor.rs) | `execute_select`, `execute_delete`, `execute_update`, plus the shared expression evaluator `eval_expr` / `eval_predicate
|
|
80
|
-
| [`src/sql/db/database.rs`](../src/sql/db/database.rs) | `Database`: table map + optional `source_path` + optional long-lived `Pager` |
|
|
81
|
-
| [`src/sql/db/table.rs`](../src/sql/db/table.rs) | `Table`, `Column`, `Row`, `
|
|
82
|
-
| [`src/sql/
|
|
100
|
+
| [`src/sql/executor.rs`](../src/sql/executor.rs) | `execute_select`, `execute_delete`, `execute_update`, plus the shared expression evaluator `eval_expr` / `eval_predicate`. Also the bounded-heap top-k optimization (Phase 7c) and the HNSW probe shortcut (Phase 7d.2). |
|
|
101
|
+
| [`src/sql/db/database.rs`](../src/sql/db/database.rs) | `Database`: table map + optional `source_path` + optional long-lived `Pager` + transaction-snapshot state |
|
|
102
|
+
| [`src/sql/db/table.rs`](../src/sql/db/table.rs) | `Table`, `Column`, `Row`, `Value` (in-memory storage incl. VECTOR + JSON columns); helpers for row iteration (`rowids`, `get_value`, `set_value`, `delete_row`, `insert_row`) |
|
|
103
|
+
| [`src/sql/hnsw.rs`](../src/sql/hnsw.rs) | Standalone HNSW algorithm — insert / search / layer assignment / beam search. Phase 7d.1. |
|
|
104
|
+
| [`src/sql/json.rs`](../src/sql/json.rs) | JSON column type + path-extraction functions (`json_extract`, `json_type`, `json_array_length`, `json_object_keys`). Phase 7e. |
|
|
105
|
+
| [`src/sql/pager/`](../src/sql/pager/) | On-disk file format and I/O — see [file-format.md](file-format.md) and [pager.md](pager.md) for details. WAL + checkpointer + shared/exclusive lock modes (Phase 4a-4e) live here. |
|
|
83
106
|
|
|
84
107
|
## Flow of a SQL statement
|
|
85
108
|
|
|
@@ -104,16 +127,18 @@ Steps 1–7 are purely in-memory; step 8 is the only disk contact, and after the
|
|
|
104
127
|
- **Planning**: intentionally not a thing yet. Execution is direct — a query plan is implicit in the executor code path.
|
|
105
128
|
- **Execution**: `src/sql/executor.rs` walks the internal structs, drives reads against `Table`, and writes via `Table::set_value` / `insert_row` / `delete_row`.
|
|
106
129
|
- **Storage (in memory)**: `src/sql/db/table.rs` — column-oriented `BTreeMap<rowid, value>` per column; indexes as separate `BTreeMap`s on UNIQUE/PK columns.
|
|
107
|
-
- **Storage (on disk)**: `src/sql/pager/` — 4 KiB pages
|
|
108
|
-
- **Persistence policy**: `src/sql/mod.rs::process_command` for when to auto-save; `src/sql/pager/mod.rs::save_database` for how.
|
|
130
|
+
- **Storage (on disk)**: `src/sql/pager/` — 4 KiB pages, real B-Tree per table (Phase 3d), secondary indexes (3e), HNSW indexes as their own page tree (7d.3), WAL + crash-safe checkpointer (4c-4d), shared/exclusive lock modes (4e).
|
|
131
|
+
- **Persistence policy**: `src/sql/mod.rs::process_command` for when to auto-save; `src/sql/pager/mod.rs::save_database` for how. Inside a `BEGIN`/`COMMIT` block, auto-save is suppressed and changes accumulate against an in-memory snapshot — `COMMIT` flushes the whole batch in one WAL frame; `ROLLBACK` restores the snapshot.
|
|
109
132
|
- **Error handling**: `src/error.rs` defines a single `SQLRiteError` enum used throughout, with `#[from]` conversions from `ParserError` and `io::Error`.
|
|
110
133
|
|
|
111
134
|
## What's deliberately missing
|
|
112
135
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- No query optimizer
|
|
116
|
-
- No
|
|
117
|
-
- No
|
|
136
|
+
The roadmap has shipped far enough that the original "deliberately missing" list mostly turned into shipped features. What's still left:
|
|
137
|
+
|
|
138
|
+
- **No query optimizer** beyond the bounded-heap top-k pass for KNN (Phase 7c) and the HNSW probe shortcut (7d.2). Equality-on-PK probes are direct; everything else is a table scan.
|
|
139
|
+
- **No joins.** `INNER` / `LEFT OUTER` / `CROSS` are parsed but rejected by the executor. On the "possible extras" list in [roadmap.md](roadmap.md).
|
|
140
|
+
- **No aggregates.** `COUNT(*)` / `SUM` / `AVG` / `GROUP BY` aren't implemented yet — the parser accepts them but the executor errors. Phase 8 candidate alongside FTS.
|
|
141
|
+
- **No network layer.** SQLRite is embedded-only. The closest thing is the [`sqlrite-mcp`](mcp.md) server, which is stdio (not network). A real wire protocol isn't on the roadmap.
|
|
142
|
+
- **No streaming row cursor.** `Rows` is currently backed by an eager `Vec` (Phase 5a). The `Rows::next` API is shaped to support a real cursor — the swap is deferred to **5a.2**.
|
|
118
143
|
|
|
119
|
-
|
|
144
|
+
Everything else from the original "deliberately missing" list (transactions, file locking, concurrency, embedding API, FFI, language SDKs, WASM, AI extensions) has shipped. See [roadmap.md](roadmap.md) for the full ledger.
|