-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathCargo.toml
More file actions
141 lines (129 loc) · 6.35 KB
/
Cargo.toml
File metadata and controls
141 lines (129 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[workspace]
# Root Cargo package (the engine crate) + the Tauri desktop app + the
# C FFI shim + the language-SDK wrappers (Python, Node.js, WASM …).
# The engine is also the workspace root's own package for historical
# compatibility with scripts that assume `cargo build` at the repo
# root produces the REPL binary.
#
# Note: sdk/wasm isn't a workspace member because its target is
# wasm32-unknown-unknown. `cargo build --workspace` on a native host
# would fail on a wasm-only crate; wasm-pack drives that build
# separately.
members = [".", "desktop/src-tauri", "sqlrite-ffi", "sqlrite-ask", "sqlrite-mcp", "sdk/python", "sdk/nodejs"]
resolver = "3"
[package]
# Published to crates.io as `sqlrite-engine` because `sqlrite` was
# already taken (unrelated project — RAG-oriented SQLite wrapper). The
# lib target below keeps `name = "sqlrite"`, so downstream Rust code
# still writes `use sqlrite::…` — only the `cargo add` line and the
# dependency declaration change:
#
# [dependencies]
# sqlrite-engine = "0.2"
# # then in code: use sqlrite::{Database, …};
#
# Any workspace member here that depends on the engine uses the
# `package =` key so the import name stays `sqlrite` internally:
# sqlrite = { package = "sqlrite-engine", path = "…" }
name = "sqlrite-engine"
version = "0.8.0"
authors = ["Joao Henrique Machado Silva <joaoh82@gmail.com>"]
edition = "2024"
rust-version = "1.85"
description = "Light version of SQLite developed with Rust. Published as `sqlrite-engine` on crates.io; import as `use sqlrite::…`."
repository = "https://github.com/joaoh82/rust_sqlite"
license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
# Library target — the engine. Used by the REPL binary below, by tests, and
# by the Tauri desktop app under `desktop/src-tauri/`. Keep the lib's public
# surface small (see `src/lib.rs`); the internals are versioned with
# on-disk format changes, so consumers should stick to the re-exports.
[lib]
name = "sqlrite"
path = "src/lib.rs"
# Binary target — the interactive REPL. Needs the `cli` feature
# (rustyline/clap/env_logger) AND the `ask` feature (sqlrite-ask
# integration for the `.ask` meta-command). Both are default-on; a
# `--no-default-features` build (e.g. for WASM or a minimal
# embedding) skips the bin entirely via `required-features`.
[[bin]]
name = "sqlrite"
path = "src/main.rs"
required-features = ["cli", "ask"]
# Phase 5a quickstart — the canonical "how do I use this as a library?"
# walkthrough. Run with `cargo run --example quickstart`. Lives under
# `examples/rust/` so the top-level `examples/` directory can fan out
# into sibling language-SDK directories (python/, nodejs/, go/, wasm/)
# as each Phase 5 sub-phase lands.
[[example]]
name = "quickstart"
path = "examples/rust/quickstart.rs"
# Phase 8d — hybrid retrieval (BM25 + vector cosine via raw arithmetic).
# Run with `cargo run --example hybrid-retrieval`. Pre-baked vectors
# (no embedding model dependency) over a 6-doc tech-blurb corpus,
# showing where pure-BM25, pure-vector, and 50/50 hybrid each win.
[[example]]
name = "hybrid-retrieval"
path = "examples/hybrid-retrieval/hybrid_retrieval.rs"
[features]
# Default build includes everything: the REPL binary (cli) and
# POSIX/Windows advisory file locks on the Pager (file-locks).
# Disabled per-feature for embeddings that don't need them —
# notably the WASM SDK, which builds the engine with
# `default-features = false` so rustyline, clap, env_logger, and
# fs2 don't try to compile against wasm32-unknown-unknown (none of
# them support that target).
default = ["cli", "ask", "file-locks"]
cli = ["dep:rustyline", "dep:rustyline-derive", "dep:env_logger", "dep:clap"]
# Phase 7g.2: optional engine integration with the `sqlrite-ask`
# natural-language → SQL crate. Adds `sqlrite::ConnectionAskExt::ask`
# (and the schema-introspection helper that powers it) when enabled.
# The core LLM/HTTP machinery still lives in `sqlrite-ask` itself —
# this feature is just the thin engine-side glue (extension trait +
# schema dump). Exists as a feature so library-only embedders
# (Tauri without ask, the WASM SDK, lean SDK builds) don't pay the
# `sqlrite-ask` weight by default.
#
# The CLI binary requires both `cli` and `ask` (see required-features
# on the `[[bin]]` section) — `.ask` is part of the standard REPL
# surface as of Phase 7g.2.
ask = ["dep:sqlrite-ask"]
file-locks = ["dep:fs2"]
[dependencies]
# Always-on engine deps — pure-Rust and wasm-compatible.
log = "0.4"
sqlparser = "0.61"
thiserror = "2.0"
prettytable-rs = "0.10"
# Phase 7e: JSON column type. `serde_json` powers both the validation
# step at INSERT time (parse-and-discard to confirm the text is valid
# JSON) and the path extraction inside the json_extract / json_type
# / json_array_length / json_object_keys SQL functions. `preserve_order`
# keeps object keys in insertion order so json_object_keys output is
# stable; without it, BTreeMap-backed Maps would alphabetically sort,
# which surprises callers re-serializing the same JSON.
serde_json = { version = "1", features = ["preserve_order"] }
# CLI-only deps (feature-gated). `optional = true` + the `cli`
# feature above means these only land in the dep graph when
# something enables the feature.
rustyline = { version = "18.0", optional = true }
rustyline-derive = { version = "0.12", optional = true }
env_logger = { version = "0.11", optional = true }
clap = { version = "4.6", features = ["cargo"], optional = true }
# Cross-platform advisory file locks. Used by the Pager for
# single-writer exclusion (Phase 4a → 4e). Feature-gated because
# fs2 wraps POSIX flock / Windows LockFileEx — neither exists on
# wasm32-unknown-unknown.
fs2 = { version = "0.4", optional = true }
# Phase 7g.2: REPL `.ask` command. Optional + gated under the `cli`
# feature because library-only embedders shouldn't have to pull in
# the LLM stack (HTTP / TLS / extra serde derives) just to use the
# engine. WASM builds skip it via `default-features = false` per
# Q9's JS-callback shape — they do prompt construction in-page but
# never make the HTTP call themselves.
#
# `version = "0.1"` is required for `cargo publish` — the engine
# crate publishes to crates.io, and a path-only dep without a
# version field fails the manifest verification step. See PR #58
# retrospective in docs/roadmap.md.
sqlrite-ask = { version = "0.8.0", path = "sqlrite-ask", optional = true }