Registry / database / capacitor-sqlite-kysely

capacitor-sqlite-kysely

JSON →
library1.0.2jsnpmunverified

A custom dialect for Kysely (>=0.26.0) that enables using Kysely query builder with Capacitor Community SQLite plugin. Current stable version: 1.0.2. Provides a connection between Kysely's type-safe SQL query building and Capacitor's SQLite driver for mobile and web. Requires manual iOS/Android configuration per @capacitor-community/sqlite. Supports encryption, mode selection, and read-only modes.

npm install capacitor-sqlite-kysely
INSTALL
IMPORT
SIG · CAPACITOR-SQLITE-K
C
capacitor-sqlite-kysely
databasejavascriptv1.0.2
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.

default
import CapacitorSQLiteKyselyDialect from 'capacitor-sqlite-kysely'
import { CapacitorSQLiteKyselyDialect } from 'capacitor-sqlite-kysely'
Uses default export, not named export.
CapacitorSQLiteKyselyConfig
import type { CapacitorSQLiteKyselyConfig } from 'capacitor-sqlite-kysely'
import { CapacitorSQLiteKyselyConfig } from 'capacitor-sqlite-kysely'
Type export only; do not use at runtime.
Kysely
import { Kysely } from 'kysely'
Standard named import from Kysely.

Initializes a Kysely instance with Capacitor SQLite dialect, configuring database name and options.

import { Kysely } from 'kysely'; import CapacitorSQLiteKyselyDialect from 'capacitor-sqlite-kysely'; import { CapacitorSQLite, SQLiteConnection } from '@capacitor-community/sqlite'; const db = new Kysely({ dialect: new CapacitorSQLiteKyselyDialect( new SQLiteConnection(CapacitorSQLite), { name: 'myDb', encryption: false, mode: 'no-encryption', version: 1, readonly: false } ), }); export default db;
Debug
Known issues
gotchaWeb platform requires additional manual configuration in @capacitor-community/sqlite (e.g., using SQLite capacitor plugin for web).
fix
Refer to @capacitor-community/sqlite docs for web setup.
affects: >=0.0.0
breakingDefault export changed to class constructor in v1.0.0; previous versions used named export.
fix
Use default import: import CapacitorSQLiteKyselyDialect from 'capacitor-sqlite-kysely'
affects: <1.0.0
deprecatedThe 'mode' option string values may change in future versions; prefer boolean 'encryption'.
fix
Set 'encryption: true' instead of 'mode: 'encryption''.
affects: >=1.0.0
gotchaDatabase name must not contain certain characters (e.g., '/') on iOS/Android.
fix
Use alphanumeric and underscore only for database names.
affects: >=0.0.0
breakingKysely peer dependency requires >=0.26.0; older Kysely versions incompatible.
fix
Upgrade Kysely to >=0.26.0
affects: <0.26.0
Errors
Common errors & fixes
Cannot find module 'capacitor-sqlite-kysely' or its corresponding type declarations.
Missing installation or not using TypeScript with 'esModuleInterop' enabled.
fix
Run npm install capacitor-sqlite-kysely kysely @capacitor-community/sqlite @capacitor/core and set 'esModuleInterop': true in tsconfig.json.
TypeError: CapacitorSQLiteKyselyDialect is not a constructor
Using named import instead of default import for the dialect.
fix
Use import CapacitorSQLiteKyselyDialect from 'capacitor-sqlite-kysely'
Property 'Kysely' does not exist on type 'typeof import("kysely")'
Wrong import style for Kysely.
fix
Use import { Kysely } from 'kysely'
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
@capacitor/corerequiredRequired by Capacitor SQLite plugin
kyselyrequiredPeer dependency for Kysely types and core
@capacitor-community/sqliterequiredActual SQLite driver used by the dialect
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
capacitor-sqlite-kysely — npm install capacitor-sqlite-kysely · libregistry