|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #76868 PDO SQLite support for SQLite's Shared Cache Mode
Submitted: 2018-09-12 08:20 UTC Modified: -
Avg. Score:4.6 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:1 (20.0%)
From: pablo dot godinez at zayon dot eu Assigned:
Status: Open Package: PDO SQLite
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: pablo dot godinez at zayon dot eu
New email:
PHP Version: OS:


 [2018-09-12 08:20 UTC] pablo dot godinez at zayon dot eu
From SQLite's documentation : (

> Beginning with SQLite version 3.7.13 (2012-06-11), shared cache can be used on in-memory databases, provided that the database is created using a URI filename

> Enabling shared-cache for an in-memory database allows two or more database connections in the same process to have access to the same in-memory database

It is possible in php to create such connection to an SQLite database using sqlite3_open function but not using PDO. 

PDO should support this URI : `sqlite::memory:?cache=shared`.

This feature would be useful for tests performances purposes. To use the memory mode we currently have to manually have each process attach to the original opened connection in order to have access to the same database.

Relevant links :


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-28 15:39 UTC] mikeryan at virtuoso-performance dot com
I would like to add that the lack of the shared cache isn't just a performance issue - when testing library code which is making its own PDO connection, you can't have the test code prepopulate an in-memory database table with test data.
 [2019-08-25 01:53 UTC] jsuprock at tenable dot com
This is actually preventing me from setting up mock, in-memory databases to inject for fully unit-testing much of our project's code.

Do you know when this will be available? I would greatly appreciate it.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 02:01:23 2020 UTC