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

@runko/persist-sqlite

v0.1.2

Published

持久化实现:SQLite(better-sqlite3)—— 你只有一个驱动实例时装这个

Readme

@runko/persist-sqlite

runko 的持久化实现,SQLite(better-sqlite3)

你只有一个驱动实例、没在用任何 ORM 时装这个。

pnpm add @runko/persist-sqlite better-sqlite3
import { createAgentRuntime } from "@runko/agent";
import { migrate, sqlitePersistence } from "@runko/persist-sqlite";
import Database from "better-sqlite3";

const db = new Database("app.db");

await migrate(db);          // 建表,幂等,跑几次都一样

const runtime = createAgentRuntime(agent, { persistence: sqlitePersistence(db) });

它是个薄壳

本包只做一件事:把你的驱动包成一个 Kysely 实例,转交 @runko/persist-kysely。三个 Store 与建表的实现都在那儿。

persist-sqlite ─┐
persist-postgres ┼─→ persist-kysely ─→ 你的库
persist-mysql  ─┘

已经在用 Kysely 了? 别用这个包——直接装 @runko/persist-kysely,把你自己的实例 给它,runko 的四张表和你的表就在同一个实例、同一套迁移之下。

一种库一个包,所以本包只 peerDependencies better-sqlite3——不会把别家的驱动拖进你的 依赖树。

它存什么

四张表:agent_ledger(账本)· agent_decisions(人工裁决留底)· agent_queue(待发队列)· agent_leases(租约表)。 表名固定,不提供前缀开关——要隔离请用 schema/database。

它不存你的东西。 runko 只认一个不透明的 conversationId,会话叫什么、属于谁, 全归你自己存。它不建外键、不碰你的用户表。

文档

功能手册 · 技术方案 · 施工进展

跑得起来的例子:apps/persist-demo——一个零 ORM 的 Hono 服务,三种库都能跑。