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

@aiao/rxdb-adapter-sqlite-core

v0.0.25

Published

`@aiao/rxdb` 的 SQLite 适配器共享内核。它把「实体 → SQL」的映射、表名解析、规则组构建、基础 Repository 与变更事件等能力抽象为后端无关的基类,供各具体 SQLite 适配器复用。

Readme

@aiao/rxdb-adapter-sqlite-core

@aiao/rxdb 的 SQLite 适配器共享内核。它把「实体 → SQL」的映射、表名解析、规则组构建、基础 Repository 与变更事件等能力抽象为后端无关的基类,供各具体 SQLite 适配器复用。

本包一般不直接安装,而是作为 @aiao/rxdb-adapter-sqlite@aiao/rxdb-adapter-sqlite-wasm@aiao/rxdb-adapter-sqliteai 等适配器的依赖被间接引入。

提供的能力

  • RxDBAdapterSqliteBase:SQLite 适配器基类,封装事务、建表与变更钩子
  • SqliteTransactionExecutorTransactionExecutor 在 SQLite 侧的实现;transaction() 回调收到的就是它
  • SqliteRepository:基于 SQLite 的类型安全 Repository 实现
  • buildRuleGroup:将查询规则编译为 SQL 条件
  • sqliteGetTableName / sqliteGetTableNameByMetadata:实体 → 表名解析
  • 后端契约类型:SqliteBackendSqliteChangeEventSQLiteChangeType

具体后端只需实现 SqliteBackend 契约即可接入。

事务 API(C2 已落地第一步)

RxDBAdapterSqliteBase.transaction() / runInTransaction() 的回调签名已收紧为接收 SqliteTransactionExecutor

import type { TransactionFun } from '@aiao/rxdb-adapter-sqlite-core';

const fun: TransactionFun = async executor => {
  // 持有 executor 才算「在本事务内」
  const repo = executor.getRepository(Todo);
  await repo.create({ title: 'inside tx' });

  // executor.execute(sql, bindings) 透传底层 client.execute,
  // 既有的 `transaction(async tx => tx.execute(sql))` 写法不受影响
  await executor.execute('SELECT 1');

  // 嵌套内层工作
  await executor.run(async inner => inner.getRepository(Todo).count());

  // 合并远端变更
  await executor.mergeChanges(actions, localChanges, /* disableTriggers */ false);
};

零参回调仍然兼容(TS 允许形参更少)。SqliteTransactionExecutor 不直接导出 —— 它是 RxDBAdapterSqliteBase 的内部产物,外部代码只通过 @aiao/rxdbTransactionExecutor 接口与之交互。

文档

License

MIT