tursodatabase / libsql-client-ts

TypeScript/JavaScript client API for libSQL

Home Page:https://docs.turso.tech/sdk/ts/quickstart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sync interval option doesn't work (mismatch with name in libsql Database constructor)

Hedrekao opened this issue · comments

When trying to create client with sync interval, in reality automatic periodic syncs never happen, due to the fact that in sqlite3.js file, following object is passed to Database constructor:

image
However, constructor in file index.js from libsql package expects field syncPeriod instead of syncInterval

image

Therefore value of syncPeriod is set to 0 and db doesn't do any automatic periodic syncs.

I'd love to try to fix this in a PR - is it sufficient to update options so that it passes through syncPeriod: config.syncInterval, or is it more correct to change the whole interface so that we replace syncInterval with syncPeriod everywhere? The syncInterval option has made its way into docs which makes me think the former option is the preferred approach

Opened PR #209 for this