New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@aibind/sqlite

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aibind/sqlite

SQLite-backed StreamStore and ConversationStore for @aibind — works with Turso, libsql, and better-sqlite3

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

@aibind/sqlite

SQLite-backed StreamStore and ConversationStore for @aibind. Works with Turso (@libsql/client), local better-sqlite3, or any driver that implements the SqliteClient interface.

Install

npm install @aibind/sqlite

Usage

// Turso / libsql
import { createClient } from "@libsql/client";
import { SqliteStreamStore, SqliteConversationStore } from "@aibind/sqlite";

const db = createClient({ url: process.env.TURSO_URL!, authToken: process.env.TURSO_TOKEN! });

const streamStore = new SqliteStreamStore(db);
const conversationStore = new SqliteConversationStore(db);
// better-sqlite3 (Node.js only)
import Database from "better-sqlite3";
import { wrapBetterSqlite3, SqliteStreamStore } from "@aibind/sqlite";

const store = new SqliteStreamStore(wrapBetterSqlite3(new Database("app.db")));
// Bun built-in sqlite
import { Database } from "bun:sqlite";
import { wrapBunSqlite, SqliteStreamStore } from "@aibind/sqlite";

const store = new SqliteStreamStore(wrapBunSqlite(new Database("app.db")));

Required schema

You must create these tables yourself — the store does not run migrations automatically.

CREATE TABLE aibind_stream_chunks (
  id   TEXT    NOT NULL,
  seq  INTEGER NOT NULL,
  data TEXT    NOT NULL,
  PRIMARY KEY (id, seq)
);

CREATE TABLE aibind_stream_status (
  id           TEXT    PRIMARY KEY,
  state        TEXT    NOT NULL DEFAULT 'active',
  error        TEXT,
  total_chunks INTEGER NOT NULL DEFAULT 0,
  expires_at   INTEGER NOT NULL
);

CREATE TABLE aibind_conversations (
  session_id TEXT    PRIMARY KEY,
  data       TEXT    NOT NULL,
  expires_at INTEGER NOT NULL
);

Custom table names are supported via options — see the full docs.

Documentation

Full docs →

Keywords

sqlite

FAQs

Package last updated on 06 Mar 2026

Related posts