npm.io
0.0.7 • Published 1 year ago

@rulodb/rulodb

Licence
Apache-2.0
Version
0.0.7
Deps
3
Size
977 kB
Vulns
0
Weekly
0

RuloDB TypeScript SDK

A strongly-typed TypeScript client for RuloDB with a fluent query builder API similar to RethinkDB.

Installation

npm install @rulodb/rulodb

Quick Start

import { RuloDB, r } from '@rulodb/rulodb';

// Create and connect to RuloDB
const client = new RuloDB({
  host: 'localhost',
  port: 6090,
  timeout: 30000
});

await client.connect();

// Insert a document
await r
  .table('users')
  .insert({
    name: 'John Doe',
    email: 'john@example.com',
    age: 30
  })
  .run(client);

// Query documents
const users = await r.table('users')
    .filter({ active: true })
    .orderBy('name')
    .limit(10)
    .run(client);

// Collect cursor and display users
console.table(await users.toArray());

await client.disconnect();

Contributing

See CONTRIBUTING.md for development setup and contribution guidelines.

License

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