This PR adds support for named in-memory SQLite databases, making it feasible to use in-memory SQLite for tenant databases in tests.
The usage is simply creating a tenant with 'tenancy_db_name' => ':memory:' and the bootstrapper will automatically update the tenant with a database name derived from its tenant key.
There are static property hooks for keeping these DBs alive (at least one connection needs to be open, they don't have process lifetime and are essentially "refcounted") and closing them when the database is deleted. This gives the user control over the lifetimes of these databases.
* Add permission controleld MSSQL DB manager
* Fix code style (php-cs-fixer)
* Fix manager
* Don't change databases when creating MSSQL user
* Test permission controlled MSSQL DB manager
* Fix code style (php-cs-fixer)
* Delete redundant config resetting in tests
* Grant user permissions insteead of making the user the database owner
* Test that user gets created in the tenant DB
* Test that the correct permissions are granted to the DB users
* Fix code style (php-cs-fixer)
* Update config comment
* Fix typo
* Add perm controlled sqlsr db manager to test dataset
* Close all connections before deleting MSSQL DBs
* Fix code style (php-cs-fixer)
* Add explanation to deleteDatabase()
* Update tests/DatabaseUsersTest.php
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
* Fix code style (php-cs-fixer)
---------
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
* complete test sqlite manager customize path
* complete test seed command works
* complete uniqe exists test
* Update SingleDatabaseTenancyTest.php
* refactor the ternary into if condition
* custom path
* simplify if condition
* random dir name
* Update SingleDatabaseTenancyTest.php
* Update CommandsTest.php
* prefix random DB name with custom_
Co-authored-by: Samuel Štancl <samuel@archte.ch>