OP-Engineering / op-sqlite

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

Libsql support #95

Closed ospfranco closed 5 days ago

ospfranco commented 2 weeks 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 days 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 5 days 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 5 days 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 5 days ago

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

abdelhameedhamdy commented 4 days ago

They are discussing such a Proof of Concept update hook.