Skip to main content

Quick Start

Get up and running with ReifyDB in 5 minutes.

Start the Database

reifydb start

Connect to ReifyDB

Using the CLI

reifydb connect

Using Rust Client

use reifydb::Client;

#[tokio::main]
async fn main() {
let client = Client::connect("reifydb://localhost:5432").await?;

// Create a table
client.execute("
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE
)
").await?;

// Insert data
client.execute("
INSERT INTO users (name, email)
VALUES ('Alice', '[email protected]')
").await?;

// Query data
let rows = client.query("SELECT * FROM users").await?;
for row in rows {
println!("{:?}", row);
}
}

Using TypeScript Client

import { ReifyDB } from '@reifydb/client';

const db = new ReifyDB('reifydb://localhost:5432');

// Create a table
await db.execute(`
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE
)
`);

// Insert data
await db.execute(`
INSERT INTO users (name, email)
VALUES ('Alice', '[email protected]')
`);

// Query data
const users = await db.query('SELECT * FROM users');
console.log(users);

Next Steps