belatuk_rethinkdb 1.0.1 copy "belatuk_rethinkdb: ^1.0.1" to clipboard
belatuk_rethinkdb: ^1.0.1 copied to clipboard

A dart driver for connecting to RethinkDB, the open-source database for the realtime web

example/example.dart

import 'package:belatuk_rethinkdb/belatuk_rethinkdb.dart';

void main() async {
  RethinkDb r = RethinkDb();
  Connection conn = await r.connect(
      db: 'testDB',
      host: "localhost",
      port: 28015,
      user: "admin",
      password: "");

  // Insert data into RethinkDB
  Map createdRecord = await r.table("user_account").insert([
    {
      'id': 1,
      'name': 'William',
      'children': [
        {'id': 1, 'name': 'Robert'},
        {'id': 2, 'name': 'Mariah'}
      ]
    },
    {
      'id': 2,
      'name': 'Peter',
      'children': [
        {'id': 1, 'name': 'Louis'}
      ],
      'nickname': 'Jo'
    },
    {'id': 3, 'name': 'Firstname Last'}
  ]).run(conn);

  print(createdRecord);

  // Retrive data from RethinkDB
  Cursor users =
      await r.table("user_account").filter({'name': 'Peter'}).run(conn);

  List userList = await users.toList();
  print(userList);

  conn.close();
}
1
likes
140
pub points
38%
popularity

Publisher

unverified uploader

A dart driver for connecting to RethinkDB, the open-source database for the realtime web

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

convert, crypto, fixnum, hashlib, protobuf

More

Packages that depend on belatuk_rethinkdb