Registry / database / baresync

baresync

JSON →
library0.3.3jsnpmunverified

SQLite-first sync infrastructure for Tauri apps at version 0.3.3. Currently in pre-release with active development. Provides schema helpers, sync generator, local DB helpers, server helpers, and a Tauri client for building offline-first desktop apps with SQLite-based sync. Key differentiators: deep integration with Tauri and Drizzle ORM, SQLite-first approach using built-in sync capabilities, and a complete end-to-end sync pipeline from schema to client. Release cadence is irregular as it is pre-release.

npm install baresync
INSTALL
IMPORT
SIG · BARESYNC
B
baresync
databasejavascriptv0.3.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

defineSchema
import { defineSchema } from 'baresync'
const { defineSchema } = require('baresync')
ESM-only; CommonJS require not supported.
SyncGenerator
import { SyncGenerator } from 'baresync'
import { SyncGenerator } from 'baresync/sync-generator'
Named export from the main package; subpath imports are not supported.
createLocalDb
import { createLocalDb } from 'baresync'
import createLocalDb from 'baresync'
Named export, not default.
type TableSchema
import type { TableSchema } from 'baresync'
import { TableSchema } from 'baresync'
TypeScript type, use `import type` to avoid runtime import.

Shows defining a SQLite table with Drizzle, generating sync configuration, and creating a local database.

import { defineSchema, SyncGenerator, createLocalDb } from 'baresync'; import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'; const todos = sqliteTable('todos', { id: integer('id').primaryKey(), title: text('title').notNull(), done: integer('done', { mode: 'boolean' }).notNull().default(false), }); const schema = defineSchema({ todos }); const syncGenerator = new SyncGenerator({ schema }); const syncConfig = syncGenerator.generate(); const db = createLocalDb('file:local.db', { schema }); console.log(syncConfig);
Debug
Known issues
breakingVersion 0.3.x API surface may change without major version bump. Review changelog before upgrading.
fix
Pin exact version in package.json until stable release.
affects: >=0.3.0 <1.0.0
deprecatedThe `SyncGenerator` constructor now requires `schema` option instead of individual table definitions.
fix
Use `new SyncGenerator({ schema })` instead of passing tables directly.
affects: >=0.3.0
gotcha`createLocalDb` expects a URL string (e.g., 'file:local.db'), not a plain path.
fix
Prefix file path with 'file:' .
affects: >=0.3.0
gotchaImporting from subpaths like 'baresync/sync-generator' will fail. Only main entry point is supported.
fix
Import all exports from 'baresync' directly.
affects: >=0.3.0
gotchaDrizzle ORM is a peer dependency. Ensure you have installed `drizzle-orm` separately.
fix
Run `npm install drizzle-orm` alongside baresync.
affects: >=0.3.0
Errors
Common errors & fixes
ERR_MODULE_NOT_FOUND: Cannot find package 'drizzle-orm' imported from .../node_modules/baresync/...
Missing peer dependency drizzle-orm.
fix
Install drizzle-orm: `npm install drizzle-orm`.
TypeError: Cannot read properties of undefined (reading 'tables')
SyncGenerator instantiated without `schema` option.
fix
Pass `{ schema }` to the constructor, where `schema` is the result of `defineSchema()`.
SQLITE_ERROR: no such table: ...
Table not created before querying. Schema is not auto-migrated.
fix
Run migrations using Drizzle Kit or `db.run(sql)` before syncing.
TypeError: db.run is not a function
Using `createLocalDb` with an incompatible database driver.
fix
Ensure you pass a `better-sqlite3` compatible database instance, or use the default SQLite driver.
Upgrade
Version history
0.3.3latest on npm
Audit
Dependencies
drizzle-ormoptionalUsed for defining SQLite schemas and migrations
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
baresync — npm install baresync · libregistry