poolCreateWithOptions method
Creates a pool with explicit eviction/timeout options (v3.0).
optionsJson keys (all optional, in milliseconds):
idle_timeout_ms, max_lifetime_ms, connection_timeout_ms.
Returns 0 on failure or when the FFI is not available.
Implementation
int poolCreateWithOptions(
String connectionString,
int maxSize, {
String? optionsJson,
}) {
if (!_bindings.supportsPoolCreateWithOptions) return 0;
final connStrPtr = connectionString.toNativeUtf8();
final optsPtr = optionsJson?.toNativeUtf8().cast<bindings.Utf8>();
try {
return _bindings.odbc_pool_create_with_options(
connStrPtr.cast<bindings.Utf8>(),
maxSize,
optsPtr,
);
} finally {
malloc.free(connStrPtr);
if (optsPtr != null) {
malloc.free(optsPtr.cast<Utf8>());
}
}
}