belatuk_rethinkdb 1.0.0 belatuk_rethinkdb: ^1.0.0 copied to clipboard
This is an unofficial driver for using RethinkDB in Dart
Belatuk RethinkDB #
This is a fork of RethinkDB Driver with update to support Dart 3.
Getting Started #
Install package #
- Install from Pub
dart pub add belatuk_rethinkdb
copied to clipboard
- Add to pubspec.yaml file
dependencies:
belatuk_rethinkdb: ^1.0.0
copied to clipboard
- Import the package into your project:
import 'package:belatuk_rethinkdb/belatuk_rethinkdb.dart';
copied to clipboard
Example #
RethinkDb r = RethinkDb();
final connection = await r.connection(
db: 'test',
host: 'localhost',
port: 28015,
user: 'admin',
password: '',
);
// Create table
await r.db('test').tableCreate('tv_shows').run(connection);
// Insert data
await r.table('tv_shows').insert([
{'name': 'Star Trek TNG', 'episodes': 178},
{'name': 'Battlestar Galactica', 'episodes': 75}
]).run(connection);
// Fetch data
var result = await r.table('tv_shows').get(1).run(connection);
copied to clipboard
Refer to RethinkDB Documentation for other types of queries.
Unit Test #
dart test
copied to clipboard