conn_pool 2.1.9

Dart native js
Flutter Android iOS web

Manages a pool of connections based several builtin strategies.

conn_pool #

Manages a pool of connections.

Shared pool #

Creating a pool #

Pool requires an instance of ConnectionManager to open and close connections. In this article, we will use PostgresManager for demonstration purposes.

final pool = SharedPool(PostgresManager('exampleDB'), minSize: 5, maxSize: 10);

Getting connection #

Connection<PostgreSQLConnection> conn = await pool.get();
PostgreSQLConnection db = conn.connection;
await db.execute(
        "CREATE TABLE posts (id SERIAL PRIMARY KEY, name VARCHAR(255), age INT);");

Releasing the connection to the pool #

await conn.release();
1
likes
100
pub points
34%
popularity

Manages a pool of connections based several builtin strategies.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

tejainece@gmail.com

License

BSD (LICENSE)

More

Packages that depend on conn_pool