diff --git a/yamdl_playground/settings.py b/yamdl_playground/settings.py index accf7b4..f054a8d 100644 --- a/yamdl_playground/settings.py +++ b/yamdl_playground/settings.py @@ -66,16 +66,30 @@ WSGI_APPLICATION = 'yamdl_playground.wsgi.application' # Database # https://docs.djangoproject.com/en/5.0/ref/settings/#databases +db_init_command = """ +PRAGMA journal_mode=OFF; +PRAGMA synchronous=OFF; +PRAGMA mmap_size = 134217728; +PRAGMA cache_size=4000; +PRAGMA temp_store=MEMORY; +""" + DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'file:default-db?mode=memory&cache=shared', - "CONN_MAX_AGE": 600 + "CONN_MAX_AGE": 600, + "OPTIONS": { + "init_command": db_init_command + } }, 'yamdl': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'file:yamdl-db?mode=memory&cache=shared', - "CONN_MAX_AGE": 600 + "CONN_MAX_AGE": 600, + "OPTIONS": { + "init_command": db_init_command + } } }