Skip to content

Instantly share code, notes, and snippets.

@aalfiann
Created January 31, 2019 13:30
Show Gist options
  • Select an option

  • Save aalfiann/acc4fdbb4a141a356ef991f397a7701f to your computer and use it in GitHub Desktop.

Select an option

Save aalfiann/acc4fdbb4a141a356ef991f397a7701f to your computer and use it in GitHub Desktop.
SQLite for big data with pragma in php way
<?php
$db = new SQLite3('/my/sqlite/file.sqlite3');
$db->busyTimeout(5000);
// WAL mode has better control over concurrency.
// Source: https://www.sqlite.org/wal.html
$db->exec('PRAGMA main.cache_size=10000;PRAGMA main.locking_mode=EXCLUSIVE;PRAGMA main.synchronous=NORMAL;PRAGMA main.journal_mode=WAL;');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment