OP-Engineering / op-sqlite

Fastest SQLite library for react-native by @ospfranco
MIT License
598 stars 41 forks source link

Libsql support #95

Closed ospfranco closed 6 months ago

ospfranco commented 6 months ago

Libsql (https://github.com/tursodatabase/libsql) is an open contribution fork of sqlite. It adds a lot of features including server replication and vector search. Some people have expressed interest in sponsoring the work to get it working within op-sqlite, I would be willing to tackle the job but it looks like multi day work so I need to make time (= money) to reserve the time for it.

Upvote & Fund

Fund with Polar

ospfranco commented 6 months ago

There is a version out that supports libsql:

@op-engineering/op-sqlite@6.0.2-beta3

enable it by modifying the package.json:

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

Caveats:

This version is using experimental C bindings from libsql, so some features might be broken. Give it a thorough test and report any issues here please.

ospfranco commented 6 months ago

There is a new version 6.0.2-beta4 adds support for remote connections:

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

const remoteDb = openRemote({
  url: 'my_url',
  authToken: '...'
});
abdelhameedhamdy commented 6 months ago

There is a version out that supports libsql:

@op-engineering/op-sqlite@6.0.2-beta3

enable it by modifying the package.json:

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

Caveats:

  • Hooks are not supported
  • Reactive queries are not supported
  • Multiple statements in a single query are not supported

This version is using experimental C bindings from libsql, so some features might be broken. Give it a thorough test and report any issues here please.

Awesome work, great to see libsql in RN, wondering is libsql missing the update hooks c bindings, if so, it really miss very important feature.

ospfranco commented 6 months ago

No, it's not about the bindings, they don't support it.

abdelhameedhamdy commented 6 months ago

They are discussing such a Proof of Concept update hook.