SimpleConnectionResolver
class SimpleConnectionResolver implements ConnectionResolverInterface
A simple, non-pooled connection resolver for testing and Capsule environments.
Unlike ConnectionResolver which uses connection pooling for Swoole coroutines, this resolver manages connections directly in memory without pooling. It's intended for:
- Unit/integration tests using in-memory SQLite
- Capsule standalone database usage
- Environments where connection pooling is not needed
For production Swoole applications, use ConnectionResolver instead.
Properties
| protected string|null | $default | The default connection name. |
Methods
Get a database connection instance.
Get the default connection name.
Set the default connection name.
Details
at line 30
__construct(DatabaseManager $manager)
No description
at line 41
ConnectionInterface
connection(UnitEnum|string|null $name = null)
Get a database connection instance.
Delegates to DatabaseManager::resolveConnectionDirectly() which manages connections in a simple array without pooling.
at line 57
string|null
getDefaultConnection()
Get the default connection name.
at line 65
void
setDefaultConnection(string|null $name)
Set the default connection name.