Installation¶
Requirements¶
- Deno 2.x or Node.js 18+
- SurrealDB 2.0+
Installing surql¶
Import directly — no install step required:
For convenience, add an import map to your deno.json:
Then import with the short alias:
Installing SurrealDB¶
macOS¶
Linux¶
Windows (PowerShell)¶
Docker¶
Running SurrealDB¶
Local Development (memory)¶
Docker¶
Docker Compose¶
services:
surrealdb:
image: surrealdb/surrealdb:latest
ports:
- "8000:8000"
command: start --user root --pass root memory
Verify the Connection¶
import { SurQLClient } from 'jsr:@oneiriq/surql'
const client = new SurQLClient({
host: 'localhost',
port: '8000',
namespace: 'test',
database: 'test',
username: 'root',
password: 'root',
})
const db = await client.getConnection()
const result = await db.query('SELECT * FROM $session')
console.log('Connected:', result)
await client.close()
Next Steps¶
- Follow the Quick Start tutorial
- Read the Schema Definition Guide
- Explore Query Builder documentation