poolCreate method

int poolCreate(
  1. String connectionString,
  2. int maxSize, {
  3. PoolOptions? options,
})
inherited

Creates a new connection pool.

The connectionString is used to establish connections in the pool. The maxSize specifies the maximum number of connections in the pool.

Returns a pool ID on success, 0 on failure.

Implementation

int poolCreate(
  String connectionString,
  int maxSize, {
  PoolOptions? options,
}) =>
    _captureSync(
      'poolCreate',
      () {
        if (options == null || !options.hasAnyOption) {
          return _native.poolCreate(connectionString, maxSize);
        }
        return _native.poolCreateWithOptions(
          connectionString,
          maxSize,
          optionsJson: options.toJson(),
        );
      },
      failed: (value) => value == 0,
    );