OP SQLite

Installation

Configuration

Gotchas

Debugging

Reactive Queries

Libsql Support

API


osp_circle.png

By Oscar Franco

Freelancer, RN/Rust magic

Twitter YouTube • [Email](mailto:[email protected]?subject=I%20need%20a%20Freelancer)

OP-SQLite also supports libsql as a “sqlite” implementation. You can just turn it on by modifying your package.json:

"op-sqlite": {
	"libsql": true
}

Currently support is experimental and feedback is appreciated.

Gotchas

Unlike regular sqlite, libsql does not support certain features but adds others. Otherwise the API is the same as regular use with sqlite.

Remote databases

Libsql allows you to connect to remote libsql databases:

import {openRemote} from '@op-engineering/op-sqlite';

const remoteDb = openRemote({
  url: 'url',
  authToken: 'token'
});

This is a purely remote database. You can however create a local database that syncs to a remote database:

import {openSync} from '@op-engineering/op-sqlite';

const remoteDb = openSync({
	name: 'myDb.sqlite',
  url: 'url',
  authToken: 'token'
});

Unsupported features

However, by using libsql the following features are not available due to lack of support of libsql itself: