rethinkdb_dart 2.3.2+6

  • Readme
  • Changelog
  • Example
  • Installing
  • 74

Build Status

Dart 2 and Flutter RethinkDB Driver #

A Dart 2 and Flutter driver for RethinkDB v2.3.

This is a fork of RethinkDB Driver, that was created to update the driver to Dart 2 and Flutter.

Getting Started: #

The driver api tries to align with the javascript and python RethinkDB drivers. You can read their documentation here.

To include this driver in your own project add the package to your pubspec.yaml file:

  rethinkdb_dart: '^2.3.2+6'

Or to use bleeding edge:

    git: git://

Or if you are a developer:

      path: /path/to/your/cloned/rethinkdb_dart

Then import the package into your project:

import 'package:rethinkdb_dart/rethinkdb_dart.dart';

Connect to the database:

var connection = await r.connect(db: "test", host: "localhost", port: 28015);

Create a table:

await r.db('test').tableCreate('tv_shows').run(connection);

Insert some data:

await r.table('tv_shows').insert([
      {'name': 'Star Trek TNG', 'episodes': 178},
      {'name': 'Battlestar Galactica', 'episodes': 75}

And work with the data:

var count = await r.table('tv_shows').count();
print("count: $count");

To update protobuf execute the following command from the project root:

bash lib/src/generated/

To run tests execute the following command from the project root:

warning: tests are run against a live database, but they do attempt to clean up after themselves

pub run test  

2.3.2+6 #

  • Fix '_GrowableList
  • Changed pbkdf2 package to pbkdf2_dart

2.3.2+5 #

  • Made 'SocketException: OS Error: Connection refused' handleable by user code

2.3.2+4 #

  • Fixed connection close listener
  • Fixed connection test according to JavaScript driver

2.3.2+3 #

  • Initial release (driver updated to Dart 2 and Flutter)


import 'package:rethinkdb_dart/rethinkdb_dart.dart';

Rethinkdb r = Rethinkdb();

void main(List<String> arguments) async {
  var connection;
  try {
    // Create the database connection.
    connection = await r.connect(db: "test", host: "localhost", port: 28015);

    // Drop the table if it exists.
    await r
        .rqlDo((databaseExists) {
      return r.branch(
          databaseExists, r.tableList(), r.db('test').tableDrop('tv_shows'));

    // Create the table if it doesn't exist.
    await r.db('test').tableList().contains('tv_shows').rqlDo((databaseExists) {
      return r.branch(
          databaseExists, r.tableList(), r.db('test').tableCreate('tv_shows'));

    // Insert some data.
    await r.table('tv_shows').insert([
      {'name': 'Star Trek TNG', 'episodes': 178},
      {'name': 'Battlestar Galactica', 'episodes': 75}

    // Display the data count.
    var count = await r.table('tv_shows').count().run(connection);
    print("count: $count");
  } catch (e) {
    print("Error: $e");
  } finally {
    if (connection != null) {

Use this package as a library

1. Depend on it

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

  rethinkdb_dart: ^2.3.2+6

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:rethinkdb_dart/rethinkdb_dart.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (protobuf).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
convert ^2.1.1 2.1.1
crypto ^2.0.6 2.1.4
pbkdf2_dart ^2.1.0 2.1.0
protobuf ^0.13.15 0.13.16+1 1.0.1
Transitive dependencies
charcode 1.1.3
collection 1.14.12
fixnum 0.10.11
typed_data 1.1.6
Dev dependencies
pedantic ^1.8.0
test ^1.6.5