@cashu/coco-expo-sqlite
v1.0.1
Published
> ⚠️ Release candidate: Coco is stabilizing for v1, but breaking changes may > still land before the final 1.0 release. Pin versions in production.
Keywords
Readme
@cashu/coco-expo-sqlite
⚠️ Release candidate: Coco is stabilizing for v1, but breaking changes may still land before the final 1.0 release. Pin versions in production.
Expo SQLite storage adapter for Coco in React Native and Expo applications.
Install
npm install @cashu/coco-core @cashu/coco-expo-sqlite
npx expo install expo-sqliteUsage
import { initializeCoco } from '@cashu/coco-core';
import { ExpoSqliteRepositories } from '@cashu/coco-expo-sqlite';
import { openDatabaseAsync } from 'expo-sqlite';
const database = await openDatabaseAsync('coco.db');
const repositories = new ExpoSqliteRepositories({ database });
await repositories.init();
const manager = await initializeCoco({
repo: repositories,
seedGetter,
});Notes
- Pass an already opened
expo-sqlitedatabase instance via thedatabaseoption. - The adapter ensures schema creation and migrations when you call
init().
