0

Can I do something like this in Django settings file:

DATABASE = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'test.sqlite3',
        'INITIAL_CMD': 'PRAGMA journal_mode=WAL',  # here
     }
}

so that whenever Django connects to default SQLite3 DB, it issues PRAGMA journal_mode=WAL first before others.
And yes, for those familiar with PHP, I need something like MYSQL_ATTR_INIT_COMMAND in MySQL PDO

adamsmith
  • 5,759
  • 4
  • 27
  • 39

1 Answers1

0

You can use the connection_created signal.

Antonis Christofides
  • 6,990
  • 2
  • 39
  • 57