Skip to main content

SDK-kit C ABI

BoutiqueDB links the engine through the sdk-kit C ABI (turso.h). This is the official surface for building language bindings, and it is the only surface that exposes async_io, per-open experimental features, and encryption.

Why sdk-kit instead of sqlite3.h

The bindings/c crate implements the SQLite 3 C API for compatibility. It is useful for dropping BoutiqueDB into existing SQLite code, but it has limits:
  • The only experimental toggle is global turso_enable_experimental(), which enables a subset of flags.
  • It cannot set async_io per open.
  • It cannot configure encryption keys per database.
sdk-kit (sdk-kit/turso.h) exposes a small, explicit C surface designed for bindings.

Key types and functions

Database lifecycle

Statement loop

Status codes

  • TURSO_OK, TURSO_DONE, TURSO_ROW
  • TURSO_IO — drive I/O and resume.
  • TURSO_BUSY — conflict or lock contention.
  • TURSO_BUSY_SNAPSHOT — MVCC snapshot conflict.
  • TURSO_ERROR — general error; check error_opt_out.

Swift mapping

TursoKit wraps these C calls into Swift types: TursoOpenOptions maps to turso_database_config_t. For the full C API, see sdk-kit/turso.h in the engine repo.