npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@playfast/reform-db-sqlite

v1.0.1

Published

bun:sqlite engine for @playfast/reform-db — a Db driver backed by Bun's built-in SQLite, with emulated reactivity and serialize()/deserialize() snapshots.

Readme

@playfast/reform-db-sqlite

The bun:sqlite engine for @playfast/reform-db.


Backs the engine-neutral Db driver from @playfast/reform-db with Bun's built-in SQLite. Zero native dependencies (it's part of the Bun runtime), serialize()/deserialize() snapshots, and emulated reactivity — SQLite has no native live queries, so a live DbQuery re-runs after every write. Your tables, queries, and migrations stay defined in the engine-neutral core.

Bun only. bun:sqlite exists only under the Bun runtime. Import this package from code that runs on Bun; on Node the module import fails (surfaced as a DbError).

Install

bun add @playfast/reform-db-sqlite @playfast/reform-db kysely

effect, kysely, @playfast/reform, and @playfast/reform-db are peer dependencies.

Quick Start

import { DbSchema, DbTable, DbColumn, Migration } from '@playfast/reform-db'
import { Sqlite } from '@playfast/reform-db-sqlite'
import { Layer } from 'effect'

const AppDb = DbSchema.make('app', { tables: [/* … */] })

// IMPORTANT: render migrations for the SQLite dialect.
const migrations = Migration.fromSchema(AppDb, Migration.sqlite)

// Persistent (a file on disk):
const DataLayer = QueriesAndProcedures.pipe(
  Layer.provideMerge(Sqlite.layer({ filename: 'app.db', migrations })),
)

// Ephemeral in-memory — the default for tests / proofs:
const TestLayer = QueriesAndProcedures.pipe(
  Layer.provideMerge(Sqlite.memory({ migrations })),
)

Both layers build the Db service synchronously (bun:sqlite opens on a background fiber inside makeDriver), so they slot straight under reform's runSync scene / proof mount.

Type storage

SQLite has no native boolean or json types, so the engine stores them as integer (0/1) and text (JSON) respectively. The column Schemas in @playfast/reform-db are engine-tolerant, so DbColumn.boolean() / DbColumn.json(schema) decode back to a real boolean / object on read — the same table definition works on both engines.

API

  • Sqlite.layer(options?) — persistent (or in-memory, if filename is omitted) Db. Options: filename?, migrations?, loadDataDir? (seed from a prior dump Blob).
  • Sqlite.memory(options?) — ephemeral in-memory Db. Options: migrations?, loadDataDir?.
  • makeSqliteEngine(options) — the raw DbEngine, for wiring makeDriver yourself.

Snapshotting: driver.dump() returns a Blob of Database.serialize() bytes; feed it back via loadDataDir to boot a database already populated (Database.deserialize).

License

MIT