WatermelonDB icon indicating copy to clipboard operation
WatermelonDB copied to clipboard

Allow raw sql queries or setting journal_mode

Open TimTreurniet opened this issue 1 year ago • 1 comments

I'm having the following issue in my use case: I want a user to be able to backup/restore a sqlite db to sd card (for a react native app using expo). The problem I'm having is that write ahead loggin (wal) seems to be enabled, which means I can't just only export/import the .db file. If I would be able to execute this query: 'PRAGMA journal_mode = DELETE;', I would be able to use a single db file for backing up and restoring. I don't think this is possible however.

Is there a way to set journal mode? Or should I be backup up/restoring in a different way?

TimTreurniet avatar Jan 24 '25 12:01 TimTreurniet

@TimTreurniet take a look at the "raw" methods on database.adapter

radex avatar Apr 07 '25 20:04 radex