Improve support for SQLite in memory database

Created on 3 July 2018, over 6 years ago
Updated 11 September 2023, over 1 year ago

Problem/Motivation

When developing Kernel test, it was found that after applying the patch, that the time to run Kernel test was reduced by between 25% and 33%. Before applying the patch, the code created a file database called ':memory:' in the application root directory and to remove it and not use the SQLite in memory database functionality.

Here is example XML element in phpunit.xml for file based SQLite database in the /tmp directory called test.sqlite.
<env name="SIMPLETEST_DB" value="sqlite://localhost//tmp/test.sqlite"/>

Here is example XML element in phpunit.xml for file based SQLite database in the application root directory called test.sqlite.
<env name="SIMPLETEST_DB" value="sqlite://localhost/test.sqlite"/>

Here is example XML element in phpunit.xml for in memory SQLite database
<env name="SIMPLETEST_DB" value="sqlite://localhost/:memory:"/>;

See http://php.net/manual/en/ref.pdo-sqlite.connection.php for more information about using a in memory database.

Please note

  • In memory database is not shared between the client and server programs when running Functional or Functional-JavaScript unit tests and hence failures.
  • A database is not needed for Unit tests.

Proposed resolution

Support sqlite database connections being set up via a db url.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

🐛 Bug report
Status

Fixed

Version

8.9 ⚰️

Component
SQLite driver 

Last updated 3 days ago

No maintainer
Created by

🇬🇧United Kingdom somersoft

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024