Syntax

client = Client({optargs})
client.connect() → void

Arguments

No arguments.

Optargs

Optional arguments to customize the behavior of the function. Provided as an object.
host
string
default:"localhost"
The hostname or IP address of the database server.
port
number
default:"6090"
The port number of the database server.
timeout
number
default:"30000"
The timeout in milliseconds for database operations.
retries
number
default:"3"
The number of retries for failed database operations.
poolSize
number
default:"10"
The maximum number of connections in the connection pool.

Returns

No return value.

Behavior

  • When a client is created, a connection pool is created internally.

Notes & Caveats

  • The client is created with a new Client instance. However, that is subject to change in future versions.

Example

Opening a connection

Filter for orders where the order’s status is shipped or delivered.
import { Client, r } from '@rulodb/rulodb';
const client = new Client();

// Connect to RuloDB
await client.connect();

await r.dbCreate('myDb').run(client);
await client.disconnect();
  • r - Referencing the query builder
  • disconnect - Disconnecting from RuloDB

Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!