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

@remix-run/data-table-sqlite

v0.6.2

Published

SQLite database implementation for remix/data-table

Downloads

20,106

Readme

data-table-sqlite

SQLite database driver for remix/data-table, backed by a synchronous SQLite client.

Features

  • Native Runtime SQLite Support: Opens a configured filename with Node's node:sqlite or Bun's bun:sqlite, or uses a compatible synchronous SQLite client
  • Full data-table API Support: Queries, relations, writes, and transactions
  • SQLite Compiler: SQL compilation is handled automatically for SQLite
  • Multi-Statement Migrations: executeScript() runs up.sql / down.sql files via Database.exec()
  • SQLite Capabilities Enabled By Default:
    • returning: true
    • savepoints: true
    • upsert: true
    • transactionalDdl: true
    • migrationLock: false

Installation

npm i remix

Usage

import { createSqliteDatabase } from 'remix/data-table/sqlite'

let db = createSqliteDatabase({
  filename: 'app.db',
  foreignKeys: true,
})

The config-backed database uses node:sqlite in Node.js and bun:sqlite in Bun. It supports db.wipe() and db.reset() because it can close and reopen the database file. Call await db.close() during application shutdown to release the connection and its file handle.

Foreign key enforcement defaults to off on every runtime. When foreignKeys is enabled, the database restores foreign key enforcement each time it opens the connection, including after destructive lifecycle operations.

The database also applies pragma busy_timeout = 5000 whenever it opens the connection, so writes wait for a locked database instead of failing immediately with SQLITE_BUSY. Use busyTimeout to override the timeout in milliseconds (0 disables the wait).

You may also pass an existing synchronous client when your application owns its lifecycle:

import { Database } from 'bun:sqlite'
import { createSqliteDatabase } from 'remix/data-table/sqlite'

let sqlite = new Database('app.db')
let db = createSqliteDatabase(sqlite)

// Leaves the supplied client open.
await db.close()

// The application closes the client it owns.
sqlite.close()

Destructive lifecycle methods are unavailable when you pass an existing client.

This is a good fit for local development, embedded deployments, and single-node services. Import any driver-specific types you need directly from your runtime's SQLite module.

Database Capabilities

data-table-sqlite reports this capability set by default:

  • returning: true
  • savepoints: true
  • upsert: true
  • transactionalDdl: true
  • migrationLock: false

Advanced Usage

Destructive Lifecycle And Locking

db.wipe() and db.reset() assume a single process owns the database file. Stop other processes before wiping: on POSIX systems another process keeps writing to the deleted inode, and on Windows an open handle blocks deletion entirely. Wiping removes the -wal, -shm, and -journal sidecar files along with the main database file so a freshly created database never associates with stale sidecars.

SQLite migrations run without a cross-process migration lock (migrationLock: false), so run migrations from one process at a time.

filename resolves against the current working directory — for remix db commands, wherever you invoke the CLI. Prefer absolute paths or paths derived from import.meta.dirname.

In-Memory Database For Tests

import { DatabaseSync } from 'node:sqlite'
import { createSqliteDatabase } from 'remix/data-table/sqlite'

let sqlite = new DatabaseSync(':memory:')
let db = createSqliteDatabase(sqlite)

Related Packages

License

See LICENSE