rethinkdb

antelopejs/rethinkdb

Official
RethinkDB client module implementing the Database interface

RethinkDB

@antelopejs/rethinkdb

npm versionLicenseTypeScript

A complete RethinkDB client module that implements the RethinkDB and Database interfaces for AntelopeJS.

For detailed documentation on the RethinkDB interfaces, please refer to:

Installation

ajs project modules add @antelopejs/rethinkdb

Overview

The AntelopeJS RethinkDB module provides functionality for interacting with RethinkDB:

  • RethinkDB client connection management through the RethinkDB interface
  • Common database operations through the Database interface

Configuration

The RethinkDB module supports two types of connections, direct connection or connection pool, both using options from the rethinkdb-ts package:

Direct Connection

// Direct connection options (RConnectionOptions)
{
    host: "localhost",       // The host to connect to
    port: 28015,             // The port to connect on
    db: "test",              // The default database
    user: "admin",           // The user account to connect as
    password: "",            // The password for the user account
    timeout: 20,             // Timeout period in seconds for the connection to be opened
    ssl: false               // Use SSL for connection
}

Connection Pool

// Connection pool options (RPoolConnectionOptions)
{
    host: "localhost",       // The host to connect to
    port: 28015,             // The port to connect on
    db: "test",              // The default database
    user: "admin",           // The user account to connect as
    password: "",            // The password for the user account
    timeout: 20,             // Timeout period in seconds
    maxConnections: 10,      // Maximum number of connections in the pool
    bufferSize: 50,          // Buffer size for the pool
    maxBufferSize: 100,      // Maximum buffer size
    discovery: false,        // Enable server discovery
    servers: []              // Additional servers for connection
}

Configuration Details

The module supports two connection methods:

  • Direct connection using r.connect() with RConnectionOptions
  • Connection pool using r.connectPool() with RPoolConnectionOptions

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.