cockroachdb_pool 1.0.1

  • Readme
  • Changelog
  • Installing
  • 48

A library to control a maximized number of connections to a CockroachDB cluster server.

Features:

  • Scans nodes list (via HTTP API) periodically, automatically add/remove nodes.
  • On critical errors or elevated timeouts it marks the node as bad and uses other nodes instead.

Usage #

Once you've created the CrdbPool object, you can:

  • Use it as PostgreSQLExecutionContext (from package:postgres).
  • Use it as PgPool (from package:postgres_pool).
  • Use CrdbPool.run for non-transactional batches with optional retry.
  • Use CrdbPool.runTx for transactional batches with optional retry.

1.0.1 #

  • Fix: settings was not propagated to the detected nodes.

1.0.0 #

  • Initial public version.

Use this package as a library

1. Depend on it

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


dependencies:
  cockroachdb_pool: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:cockroachdb_pool/cockroachdb_pool.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Jul 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web

Because:

  • package:cockroachdb_pool/cockroachdb_pool.dart that imports:
  • package:postgres_pool/postgres_pool.dart that imports:
  • package:postgres/postgres.dart that imports:
  • package:postgres/src/substituter.dart that imports:
  • package:postgres/src/query.dart that imports:
  • package:postgres/src/execution_context.dart that imports:
  • package:postgres/src/connection.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:cockroachdb_pool/cockroachdb_pool.dart that imports:
  • package:postgres_pool/postgres_pool.dart that imports:
  • package:postgres/postgres.dart that imports:
  • package:postgres/src/substituter.dart that imports:
  • package:postgres/src/query.dart that imports:
  • package:postgres/src/execution_context.dart that imports:
  • package:postgres/src/connection.dart that imports:
  • dart:io

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and cockroachdb_pool.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
http ^0.12.0 0.12.1
meta ^1.0.0 1.2.2 1.3.0-nullsafety
postgres_pool ^2.0.0 2.0.1
retry ^3.0.0 3.0.1
Transitive dependencies
buffer 1.0.7
charcode 1.1.3
collection 1.14.13 1.15.0-nullsafety
convert 2.1.1
crypto 2.1.5
executor 2.2.1
http_parser 3.1.4
path 1.7.0
postgres 2.1.1
source_span 1.7.0
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0 1.3.0-nullsafety
Dev dependencies
docker_process ^1.2.0
pedantic ^1.8.0 1.9.2
test ^1.6.0