Syntax

rbuilder

Arguments

No arguments.

Optargs

No optional arguments.

Returns

builder
object
The query builder object.

Behavior

  • The r object is the starting point for all RuloDB queries.
  • Provides access to database operations, table operations, and utility functions.
  • All queries must begin with r followed by the appropriate method chain.

Notes & Caveats

  • The r object is imported from the RuloDB SDK.
  • Queries built with r are not executed until .run(client) is called.

Example

Basic query building

Use r to start building database queries.
import { Client, r } from '@rulodb/rulodb';

const client = new Client();
await client.connect();

// Use `r` to build a query
await r.dbCreate('myDb').run(client);

Query chaining

Chain multiple operations starting with r.
await r
  .table('users')
  .filter((doc) => doc.age.ge(18))
  .run(client);

Database operations

Access database-level operations through r.
// List all databases
const cursor = await r.dbList().run(client);
const databases = await cursor.toArray();

// Select a specific database
await r.db('myApp').tableCreate('users').run(client);

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