triplit icon indicating copy to clipboard operation
triplit copied to clipboard

sqlite in nextjs pwa project

Open wanghaisheng opened this issue 9 months ago • 1 comments

should we use https://docs.expo.dev/versions/latest/sdk/sqlite/ as describe in https://www.triplit.dev/docs/client/storage#in-react-native

if i want to build a pwa application use nextjs+triplit+sqlite

wanghaisheng avatar Mar 16 '25 15:03 wanghaisheng

I dont think expo-sqlite works on the web. However you can try our server side sqlite package by importing it from@triplit/client/storage/sqlite.

Im unsure that will work in a PWA (it would depend on the comparability of https://github.com/WiseLibs/better-sqlite3). There is a wasm build for sqlite in browser environments (https://github.com/sqlite/sqlite-wasm) which might work well here, but we dont have an officially supported adapter.

wernst avatar Mar 17 '25 07:03 wernst

Generally our advice is to use IndexedDB on the Client for a PWA and then SQLite on the server--which works out of the box for Triplit Cloud and the Triplit Server Docker image .

matlin avatar May 12 '25 18:05 matlin