|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-09-12 08:20 UTC] pablo dot godinez at zayon dot eu
Description: ------------ From SQLite's documentation : (https://www.sqlite.org/sharedcache.html) > 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 : https://stackoverflow.com/questions/16487679/shared-cache-on-pdo-sqlite https://stackoverflow.com/questions/9150319/enable-shared-pager-cache-in-sqlite-using-php-pdo https://github.com/doctrine/dbal/issues/2901 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 16:00:01 2025 UTC |
> PDO should support this URI : `sqlite::memory:?cache=shared`. As of PHP 8.1.0, the following is supported having the same effect: sqlite:file::memory:?cache=shared However, that doesn't work, if open_basedir is set. Would that be a problem for you?