1.2.0 • Published 1 year ago

expo-sqlite-storage v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Expo SQLite Storage

ios android web expo expo go expo-sqlite sqlite-android

Implements the original expo-sqlite with an updated version of android.database.sqlite from requery.sqlite-android which adds support for:

  • JSON1 extension
  • Common Table expressions
  • Indexes on expressions
  • Full Text Search 5
  • Generated Columns
  • DROP COLUMN support

This cannot be used in Expo GO, see the related error section.

RxDB Premium compatible

It's compatible with RxDB Premium SQLite storage:

import {
  getRxStorageSQLite,
  getSQLiteBasicsExpoSQLite,
} from "rxdb-premium/plugins/storage-sqlite";
import * as ExpoSqliteStorage from "expo-sqlite-storage";
import { createRxDatabase } from "rxdb";

const storage = getRxStorageSQLite({
  sqliteBasics: getSQLiteBasicsExpoSQLite(ExpoSqliteStorage.openDatabase),
});

const db = await createRxDatabase({
  name: storage.name,
  storage,
  multiInstance: false,
  ignoreDuplicate: true,
});
iOSAndroid

Installation in managed Expo project

Add the package to your npm dependencies

npm install expo-sqlite-storage

or

yarn add expo-sqlite-storage

build your native apps

npx expo run:android|ios

run only the app

npx expo start --dev-client

Error

{"name":"TypeError","message":"null is not an object (evaluating 'SQLiteDatabase.exec')

Will not work inside Expo GO until the Expo team updates their SQLite database to a more recent version.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install expo-sqlite-storage

or

yarn add expo-sqlite-storage

Configure for iOS

React-Native above 0.60:

Run npx pod-install after installing the npm package.

Configure for Android

1.2.0

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago