doccano / doccano/doccano

Have you thought of enabling WAL mode for SQLite?

Open
#1,968 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
10.8k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Have you thought of enabling SQLite's [Write-Ahead Logging](https://sqlite.org/wal.html)?

This allows simultaneous writes and reading, which would improve the performance when using SQLite with no real downside.

I've done this in other Django projects using the `connection_created` signal (see example below). I'd be happy to make this change and open a pull request, if you'd like.

```
@receiver(connection_created)
def setup_sqlite(connection, **kwargs):
if connection.vendor != "sqlite":
return

with connection.cursor() as cursor:
cursor.execute("pragma journal_mode = WAL;")
cursor.execute("pragma synchronous = normal;")
cursor.execute("pragma temp_store = memory;")
cursor.execute("pragma mmap_size = 256000000;")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.