#setting pragma journal_mode=wal (targeting erlang)

1 messages · Page 1 of 1 (latest)

umbral plaza
#

Seems to have hit a slight issue where I am unable see the result of setting journal_mode to wal. I am most familiar with Go's mattyn/go-sqlite library which has an API around it.

I am using the latest sqlite3 version so unsure if I am missing something in Gleam or missing something with SQLite but all the docs and Googling seem to suggest I just need to set pragma journal_mode = wal; after I connect.

I've tried to run the following script (the pragma for the foreign keys seems to work tho)

  pragma journal_mode=wal;
  pragma synchronous=normal;

  create table users (
    id int
  ) strict;

  insert into users (id) values (1)
tropic hornet
#

You just execute pragma journal_mode=wal;

#

No special API for it

#

It's a valid SQLite statement

umbral plaza
#

Yh that’s why I’m confused what’s not working for me. I’m just using the SQLite3 that’s installed on my device

tropic hornet
#

What do you mean it's not working?

#

And SQLight doesn't use your system SQLite

umbral plaza
#

Is there supposed to be two additional files that get created when setting wal mode (-wal and -shm)?

#

As this doesn’t seem to be created

tropic hornet
#

Not until you do some operation that will create them

#

If there's no errors then you're good.

umbral plaza
#

ah ok, im probs being impatient soz

tropic hornet
#

You could run pragma journal_mode; with sqlite to see what mode is in use

#

But generally if there's on error printed then you don't have any problems