duckdb / sqlite_scanner

DuckDB extension to read and write to SQLite databases
MIT License
189 stars 19 forks source link

Add more options for opening SQLite databases - busy_timeout and journal_mode - and set busy time-out by default #83

Closed Mytherin closed 4 months ago

Mytherin commented 4 months ago

Fixes #82

This PR adds two new settings when attaching SQLite databases - busy_timeout and journal_mode.

Usage:

ATTACH 'file.db' AS f (TYPE SQLITE, BUSY_TIMEOUT 0);
ATTACH  'file.db' AS f (TYPE SQLITE, JOURNAL_MODE 'WAL');

This fixes the linked issue by specifying a busy time-out by default which prevents database is locked errors from appearing until after the timeout has passed. To restore previous behavior where the system would immediately return database is locked a busy_timeout of 0 can be specified.