conn_pool 2.1.8

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 76

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();

Change log

2.1.5

  • Minor improvements to SharedPool release

2.1.3

  • Documentation

2.1.2

  • Updated README

2.1.1

  • SharedPool

example/example.dart

import 'package:conn_pool/conn_pool.dart';

main() {}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  conn_pool: ^2.1.8

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:conn_pool/conn_pool.dart';
  
Version Uploaded Documentation Archive
2.1.8 Aug 27, 2018 Go to the documentation of conn_pool 2.1.8 Download conn_pool 2.1.8 archive
2.1.6 Aug 8, 2018 Go to the documentation of conn_pool 2.1.6 Download conn_pool 2.1.6 archive
2.1.5 Jul 8, 2018 Go to the documentation of conn_pool 2.1.5 Download conn_pool 2.1.5 archive
2.1.4 Jul 7, 2018 Go to the documentation of conn_pool 2.1.4 Download conn_pool 2.1.4 archive
2.1.1 Jul 7, 2018 Go to the documentation of conn_pool 2.1.1 Download conn_pool 2.1.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
52
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:conn_pool/conn_pool.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.3.0