mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 17:54:03 +00:00
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. |
||
|---|---|---|
| .. | ||
| Concerns | ||
| Contracts | ||
| Exceptions | ||
| Models | ||
| TenantDatabaseManagers | ||
| DatabaseConfig.php | ||
| DatabaseManager.php | ||
| ParentModelScope.php | ||
| TenantCollection.php | ||
| TenantScope.php | ||