Skip to content

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 16 Mar 18:49
· 53 commits to main since this release
2315b32

[0.5.0] - 2026-03-16

Major feature release. Substantial surface added; several subtle
behavioral changes worth noting on upgrade.

Added

  • Online backup API. XqliteNIF.backup/2 + restore/2 (one-shot),
    plus backup_with_progress/6 (page-by-page with progress messages to
    a PID, cancel-token support).
  • Session extension. session_new, session_attach, session_changeset,
    session_delete, changeset_invert, changeset_concat,
    changeset_apply with conflict strategies (:omit, :replace,
    :abort).
  • Incremental blob I/O. blob_open, blob_read, blob_write,
    blob_close. Read and write multi-GB column values without loading
    them into memory.
  • Extension loading. enable_load_extension/2 and
    load_extension/2,3. Opt-in; disabled by default.
  • Serialize / deserialize. serialize/1 captures the entire live
    database as a single binary byte-for-byte identical to its on-disk
    form; deserialize/2 loads it back.
  • Log hook and update hook via raw enif_send. Per-connection
    update notifications as {:xqlite_update, action, db, table, rowid};
    global log hook as {:xqlite_log, code, message}.
  • Type extension behaviour. Xqlite.TypeExtension for bidirectional
    Elixir↔SQLite conversion. Built-ins shipped for DateTime, Date,
    Time, NaiveDateTime.
  • Xqlite.Result struct implementing the Table.Reader protocol —
    consumable directly by Explorer, Kino, VegaLite.
  • XqliteNIF.transaction_status/1 — structured query of the
    current connection's transaction state.
  • Read-only opens. open_readonly/1 and open_in_memory_readonly/1.
  • Transaction modes. deferred, immediate, exclusive.
  • Schema-prefixed PRAGMAs. :db_name option for PRAGMAs that accept
    a database name parameter.

Changed

  • PRAGMA schema reworked from a keyword list to Xqlite.PragmaSpec
    structs. Public shape change for anyone introspecting PRAGMA
    metadata.
  • PRAGMA SET now returns the echoed value instead of discarding it,
    matching the {:ok, echoed_value} shape of the rest of the API.
  • XqliteNIF.close/1 eagerly releases the underlying SQLite
    connection
    rather than waiting for Elixir GC.
  • rusqlite upgraded 0.38 → 0.39. UTF-8 errors now carry the column
    index of the offending value.

Fixed

  • Stream finalization data race where sqlite3_finalize could run
    without the connection Mutex held — a BEAM-segfault-class bug.
  • stream_fetch now holds the Mutex for the entire fetch loop (was
    dropping it between steps).
  • TOCTOU race in the with_conn closed-flag check.
  • Atom-table exhaustion protection: user input no longer becomes atoms
    unconditionally.
  • SQL length overflow guard in stream_open.
  • Integer-truncation guard for FFI bind calls.
  • Identifier quoting: single quotes → double quotes for SQLite spec
    compliance.
  • PRAGMA name validation against SQL injection (reject non-identifier
    PRAGMA names).
  • PRAGMA validation catch-all for unknown names and corrected numeric
    ranges.
  • Interruption detection, cancel ordering, and error-code mapping.