poolCreate method
Creates a new connection pool.
The connectionString must be a non-empty ODBC connection string
used to establish connections in the pool.
The maxSize must be at least 1, specifying the maximum number
of connections in the pool.
Returns a pool ID on success, which must be used for pool operations. Returns a ValidationError if connection string is empty or maxSize < 1.
Implementation
Future<Result<int>> poolCreate(
String connectionString,
int maxSize,
) async {
if (connectionString.trim().isEmpty) {
return const Failure<int, OdbcError>(
ValidationError(message: 'Connection string cannot be empty'),
);
}
if (maxSize < 1) {
return const Failure<int, OdbcError>(
ValidationError(message: 'Pool max size must be at least 1'),
);
}
return _repository.poolCreate(connectionString, maxSize);
}