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

joaoh82 / rust_sqlite / 25233492072
69%

Build:
DEFAULT BRANCH: main
Ran 01 May 2026 09:19PM UTC
Jobs 1
Files 38
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

01 May 2026 09:15PM UTC coverage: 57.634% (-0.6%) from 58.257%
25233492072

push

github

web-flow
Phase 7g.5: Node.js SDK db.ask() / askRun() / AskConfig (#66)

napi-rs wrappers for natural-language → SQL via the engine's
`sqlrite::ask` module. Mirrors Python SDK 7g.4 with idiomatic JS
API shape (camelCase option-object instead of kwargs).

## Public surface

```js
import { Database, AskConfig } from '@joaoh82/sqlrite';

const db = new Database('foo.sqlrite');

// Path 1: env var (zero config — same env as REPL/Desktop/Python)
const resp = db.ask('How many users are over 30?');

// Path 2: explicit per-call config (overrides env)
const cfg = new AskConfig({
  apiKey: 'sk-ant-...',
  model: 'claude-haiku-4-5',
  maxTokens: 512,
  cacheTtl: '1h',
});
const resp = db.ask('How many users?', cfg);

// Path 3: per-connection config (set once, reuse)
db.setAskConfig(cfg);
const resp = db.ask('How many users?');

// Convenience: generate + execute in one call
const rows = db.askRun('list active users');
```

## What's new

  * `new AskConfig({apiKey, model, maxTokens, cacheTtl, baseUrl})` —
    camelCase option-object constructor. Each field optional; missing
    fields fall back to defaults (anthropic / claude-sonnet-4-6 /
    1024 / 5m).
  * `AskConfig.fromEnv()` — reads SQLRITE_LLM_* env vars.
  * `cfg.hasApiKey` / `cfg.model` / `cfg.maxTokens` / `cfg.cacheTtl` /
    `cfg.provider` — getters. Note `hasApiKey` (boolean) instead of
    exposing the key value.
  * `cfg.toString()` — human-readable representation that
    deliberately omits the API key value (shows `<set>` or `null`).
  * `Database.ask(question, config?)` → `AskResponse { sql,
    explanation, usage }`. Does NOT execute.
  * `Database.askRun(question, config?)` → executes generated SQL,
    returns rows directly (`Array<Object>`). Throws on empty SQL
    response (model declined) with the model's explanation.
  * `Database.setAskConfig(config | null)` — per-connection storage.
  * Auto-generated TypeScript types in `index.d.ts` for
    `AskConfigOptions`, `AskResponse`, `AskUsage` interfac... (continued)

0 of 102 new or added lines in 1 file covered. (0.0%)

5496 of 9536 relevant lines covered (57.63%)

1.18 hits per line

Uncovered Changes

Lines Coverage ∆ File
102
0.0
0.0% sdk/nodejs/src/lib.rs
Jobs
ID Job ID Ran Files Coverage
1 25233492072.1 01 May 2026 09:19PM UTC 38
57.63
GitHub Action Run
Source Files on build 25233492072
  • Tree
  • List 38
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 6024c2e9 on github
  • Prev Build on main (#25212209041)
  • Next Build on main (#25234072556)
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