This guide will walk you through the process of setting up and running RuloDB on your machine, connecting to it using an SDK, and running your first query.It takes approximately 5 minutes to complete this guide. Get your coffee and let’s get started!
As RuloDB is in early stages of development, a limited set of architectures are supported. Builds
are available for x86_64 (on Ubuntu/Debian & Windows) and arm64 (on macOS) architectures. If you
happen to be using a different architecture, you can build RuloDB from
source.
1
Download RuloDB
Visit the RuloDB releases page and find the appropriate version for your operating system.
Copy
# Replace $DIST with your distribution (e.g., linux, windows, macos)curl -sSL https://github.com/rulodb/rulodb/releases/latest/download/rulodb-$DIST -o rulodbchmod +x ./rulodb
2
Start RuloDB
Navigate to the extracted directory and run the binary.
Copy
# Start RuloDB with your desired log levelRUST_LOG=rulodb=info ./rulodb start
Currently, the only available SDK is the TypeScript SDK. More SDKs are coming later, when the
query language reaches a somewhat stable state. The steps below are assuming that you have
Bun installed. However, the TypeScript SDK is not depending on any features of
Bun, so you may use other runtimes.
1
Create a new project
Create a new directory and install the RuloDB Typescript client.
Create a new file, main.ts, with the following content:
Copy
// Import RuloDB SDKimport { Client, r } from '@rulodb/rulodb';// Connect to RuloDBconst client = new Client({ host: 'localhost', port: 6090 });await client.connect();// Create heroes table if not existsconst tables = await r.db().tableList().run(client);if (!(await tables.toArray()).includes('heroes')) { await r.db().tableCreate('heroes').run(client); console.log('✅ heroes table created');}const heroesTable = r.db().table('heroes');// Insert a document into the default tableawait heroesTable .insert({ name: 'Thor', power: 100 }) .run(client);console.log('✅ your hero got inserted');// Get a cursor for the default tableconst cursor = await heroesTable.run(client);// Collect the cursor and print all heroesconsole.table(await cursor.toArray());// Close the client connectionawait client.disconnect();
3
Execute the script
Run main.ts using Bun to create a new document in the default table.
Copy
bun main.ts
In your terminal, you should see the newly inserted document. Congratulations! 🥳 You have successfully connected to RuloDB, created a new table, and inserted a document.
Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!