• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joaoh82 / rust_sqlite / 25135158388
69%

Build:
DEFAULT BRANCH: main
Ran 29 Apr 2026 09:39PM UTC
Jobs 1
Files 36
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Apr 2026 09:36PM UTC coverage: 67.839% (-1.2%) from 69.031%
25135158388

push

github

web-flow
Phase 7g.1: sqlrite-ask crate (foundational) (#56)

Lays the groundwork for the ask() API across the product surface
(Phase 7g.2-7g.8) by introducing a brand-new workspace member:
the sqlrite-ask crate. It turns an open Connection + a natural-
language question into generated SQL by walking the schema, building
a cache-friendly prompt, and POSTing once to Anthropic's Messages
API.

The engine itself stays pure-SQL — no HTTP, TLS, async, or serde
deps creep in. Anyone embedding SQLRite who doesn't want LLM calls
ignores this crate entirely.

Public API (Rust):

    use sqlrite::Connection;
    use sqlrite_ask::{AskConfig, ConnectionAskExt};

    let conn = Connection::open("foo.sqlrite")?;
    let cfg  = AskConfig::from_env()?;             // SQLRITE_LLM_API_KEY etc.
    let resp = conn.ask("How many users are over 30?", &cfg)?;
    println!("{}", resp.sql);          // generated SQL
    println!("{}", resp.explanation);  // one-sentence rationale

The library deliberately does NOT execute the returned SQL — that's
the caller's call. Per-SDK convenience helpers (ask_run / askRun /
AskRun) ship in 7g.2-7g.8 alongside the per-product wrappers.

Module layout (sqlrite-ask/src/):

  schema.rs      — dump_schema(&Connection) / dump_database(&Database)
                   walks Database.tables alphabetically (deterministic
                   for prompt caching) and renders CREATE TABLE
                   statements with the canonical SQL keywords
                   (INTEGER / TEXT / REAL / BOOLEAN / VECTOR(N) / JSON).

  prompt.rs      — SystemBlock, CacheControl, UserMessage, build_system().
                   Two-block system prompt: frozen rules first (byte-
                   stable across every call regardless of which DB),
                   then the schema dump wrapped in <schema>...</schema>
                   with cache_control: ephemeral. The LLM is asked to
                   reply with strict JSON {"sql": ..., "explanation": ...}.

  provider/    ... (continued)

0 of 137 new or added lines in 5 files covered. (0.0%)

5381 of 7932 relevant lines covered (67.84%)

1.4 hits per line

Uncovered Changes

Lines Coverage ∆ File
49
0.0
sqlrite-ask/src/provider/anthropic.rs
36
0.0
sqlrite-ask/src/lib.rs
33
0.0
sqlrite-ask/tests/anthropic_http.rs
14
0.0
sqlrite-ask/src/provider/mock.rs
5
0.0
sqlrite-ask/src/prompt.rs
Jobs
ID Job ID Ran Files Coverage
1 25135158388.1 29 Apr 2026 09:39PM UTC 36
67.84
GitHub Action Run
Source Files on build 25135158388
  • Tree
  • List 36
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8f3fac75 on github
  • Prev Build on main (#25133039769)
  • Next Build on main (#25135298350)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc