Closed alanjhughes closed 7 months ago
Once the old one is gone, are you ok with this being called 'next' for ever?
It's ok with me but I'll defer to @brentvatne
Amazing. Thanks!
ideally we'd remove the next
from the name after the old one is gone. this won't be until about april.
@alanjhughes Are you planning on creating a simpler example project without the syncing using CR-SQLite? I'm asking because I'm running into problems with a simple set up:
db.ts
db.execSync(`CREATE TABLE IF NOT EXISTS test (id PRIMARY KEY, name TEXT);`);
App.tsx
const store = useCreateStore(createStore);
useCreatePersister(
store,
(store) =>
createExpoSqliteNextPersister(store, db, {
mode: "tabular",
tables: {
load: {
test: { tableId: "test", rowIdColumnName: "id" },
},
save: {
test: { tableName: "test", rowIdColumnName: "id" },
},
},
}),
[db],
async (persister) => {
await persister.startAutoLoad();
await persister.startAutoSave();
},
);
const addData = useCallback(
() => store.setCell("test", nanoid(10), "name", "testtest"),
[store],
);
When addData is called, it is not saved to the SQL database. I also cannot see data I insert using SQL in TinyBase.
If I add console.info to the createExpoSqliteNextPersister
I get
INFO BEGIN undefined
INFO BEGIN undefined
INFO BEGIN undefined
INFO BEGIN undefined
Summary
We'd like to add a new persister to support the next version of
expo-sqlite
which is a ground up rewrite. The plan would be to deprecate the legacy persister and API once the new api has been available for an SDK cycle or two.How did you test this change?
Tested in the example project we used for the original persister. Can be seen here