1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 17:54:03 +00:00
tenancy/src/Database
Samuel Štancl 48b916e182
Supported named in-memory SQLite databases (#69)
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.
2024-11-25 04:48:52 +01:00
..
Concerns Fix pullFromPendingPool() behavior (#70) 2024-11-25 04:44:39 +01:00
Contracts Tenant DB manager database() -> connection() 2024-09-12 18:34:45 +02:00
Exceptions Postgres RLS + permission controlled database managers (#33) 2024-04-24 22:32:49 +02:00
Models more phpstan fixes 2024-08-06 18:26:46 +02:00
TenantDatabaseManagers Supported named in-memory SQLite databases (#69) 2024-11-25 04:48:52 +01:00
DatabaseConfig.php sqlite: use .sqlite suffix if db.suffix is empty 2024-09-30 16:49:46 +02:00
DatabaseManager.php Supported named in-memory SQLite databases (#69) 2024-11-25 04:48:52 +01:00
ParentModelScope.php fix phpstan errors 2024-08-06 04:35:25 +02:00
TenantCollection.php fix phpstan errors 2024-08-06 04:35:25 +02:00
TenantScope.php fix phpstan errors 2024-08-06 04:35:25 +02:00