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

joaoh82 / rust_sqlite / 25234956065
69%

Build:
DEFAULT BRANCH: main
Ran 01 May 2026 10:02PM 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:58PM UTC coverage: 57.634%. Remained the same
25234956065

push

github

web-flow
Phase 7g.6: Go SDK sqlrite.Ask() / AskRun() / AskConfig via cgo (#68)

cgo wrapper for natural-language → SQL via the engine's
`sqlrite::ask` module. Same three-layer config precedence as
Python (7g.4) and Node (7g.5), with idiomatic Go shape: free
functions on `*sql.DB` plus context-aware variants.

## Public surface

```go
import (
    "database/sql"
    sqlrite "github.com/joaoh82/rust_sqlite/sdk/go"
)

db, _ := sql.Open("sqlrite", "foo.sqlrite")

// Path 1: nil cfg → reads SQLRITE_LLM_API_KEY etc. from env
resp, err := sqlrite.Ask(db, "How many users are over 30?", nil)

// Path 2: explicit per-call config
cfg := &sqlrite.AskConfig{
    APIKey:    "sk-ant-...",
    Model:     "claude-haiku-4-5",
    MaxTokens: 512,
    CacheTTL:  "1h",          // "5m" (default) | "1h" | "off"
}
resp, _ := sqlrite.Ask(db, "list users", cfg)

// Convenience: generate + execute
rows, _ := sqlrite.AskRun(db, "list users", nil)
defer rows.Close()
for rows.Next() {
    var id int64; var name string
    rows.Scan(&id, &name)
}

// Context-aware variants for connection-pool acquisition control
resp, err := sqlrite.AskContext(ctx, db, "...", cfg)
rows, err := sqlrite.AskRunContext(ctx, db, "...", cfg)
```

## What's new

  * `sqlrite.AskConfig` struct — Provider / APIKey / Model /
    MaxTokens / CacheTTL / BaseURL. JSON tags match the FFI's
    snake_case ABI for direct serialization.
  * `sqlrite.AskConfigFromEnv()` — reads SQLRITE_LLM_*. Builds a
    config callers can inspect / log / mutate before passing to
    Ask. Returns error on invalid SQLRITE_LLM_MAX_TOKENS.
  * `(*AskConfig).String()` — debug-friendly repr that **omits the
    API key value** (shows `<set>` or `<unset>`). Lets callers
    `fmt.Println(cfg)` in logs without leaking the secret.
  * `sqlrite.Ask(db, question, *AskConfig) (*AskResponse, error)`
    — generates SQL, does NOT execute. Plus `AskContext(ctx, ...)`.
  * `sqlrite.AskRun(db, question, *AskConfig) (*sql.Rows, error)`
    — generates AND e... (continued)

5496 of 9536 relevant lines covered (57.63%)

1.18 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25234956065.1 01 May 2026 10:02PM UTC 38
57.63
GitHub Action Run
Source Files on build 25234956065
  • Tree
  • List 38
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • aedf11e0 on github
  • Prev Build on main (#25234072556)
  • Next Build on main (#25235008657)
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