Skip to main content

serp-sqlite

Embedded SQLite for Serpentine. Runtime-backed ([R]): native builds load the system SQLite library dynamically at first use — winsqlite3.dll (shipped with Windows 10+) or sqlite3.dll on Windows, libsqlite3.so.0 on Linux, libsqlite3.dylib on macOS — no link-time dependency. Under CPython the same imports delegate to the stdlib sqlite3 module in autocommit mode.

from serp_sqlite import (connect, close, execute, prepare, bind_int,
                         bind_text, step, col_int, col_text, finalize)

db: int = connect("app.db")
execute(db, "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)")

st: int = prepare(db, "INSERT INTO users (name) VALUES (?)")
bind_text(st, 1, "ada")
step(st)
finalize(st)

q: int = prepare(db, "SELECT id, name FROM users ORDER BY id")
while step(q):
    print(col_int(q, 0), col_text(q, 1))
finalize(q)
close(db)

API

Handles are opaque ints.

  • connect(path) -> int, close(db)
  • execute(db, sql) — one statement, no result rows
  • changes(db) -> int, last_rowid(db) -> int
  • prepare(db, sql) -> int
  • bind_int/bind_float/bind_text/bind_blob(stmt, idx, v), bind_null(stmt, idx) — 1-based ? parameters
  • step(stmt) -> bool — True while a row is available
  • column_count(stmt) -> int
  • col_type(stmt, i) -> int — 1=INTEGER, 2=FLOAT, 3=TEXT, 4=BLOB, 5=NULL (0-based columns)
  • col_int/col_float/col_text/col_blob(stmt, i)
  • reset(stmt) — rewind, keeping bindings; finalize(stmt)

SQLite errors surface as ValueError carrying the SQLite error message (e.g. no such table: users) in both worlds.

Usage rules

  • Call column getters only after a step that returned True, and use the getter matching col_type — cross-type getters are not guaranteed to agree between worlds.
  • Call column_count after the first step (the CPython delegate defers execution to the first step).
  • execute takes exactly one statement; use multiple calls for scripts.
  • If no SQLite library can be found natively, calls raise OSError("SQLite library not found").

Metadata

Release files for serp-sqlite 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for serp-sqlite 0.3.0
File Size Uploaded Provenance Actions
serp_sqlite-0.3.0.tar.gz 7.7 kB With provenance Details for serp_sqlite-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for serp-sqlite 0.3.0
File Interpreter ABI Platform Actions
serp_sqlite-0.3.0-py3-none-any.whl Python 3 none any Details for serp_sqlite-0.3.0-py3-none-any.whl

Total release size: 14.8 kB

Release files / serp_sqlite-0.3.0.tar.gz

Download URL serp_sqlite-0.3.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0cfccafd0b7fc8e2dcff90421547da3949e40bf410a199fe01ccb3f64e13f248
BLAKE2b-256 checksum
How to use checksums
7ae73efb10904a21a9cd9befb6b894568f47ca17cfe83c3131bc59422dddf366
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / serp_sqlite-0.3.0-py3-none-any.whl

Download URL serp_sqlite-0.3.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a395947a2d572e01ef4c20ff6239eccb8c50b838f83ae63730ac1f34c2706cf
BLAKE2b-256 checksum
How to use checksums
65b12215cd56d9a4bcbb99ab0cbc4942a0ce9f47b477719876485863d2a2e831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for serp-sqlite 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for serp_sqlite-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page