Database ORM
A natively compiled Query Builder that avoids raw SQL entirely while running at maximum CGO speeds.
Retrieving Data
Chain filters safely without SQL Injection vulnerabilities. The engine handles parameter binding automatically.
const users = db.table("user").limit(5).list();
// Filter Single Row
const admin = db.table("user").where((u) => u.role == "admin").first();
Create & Update
Manipulate data using pure JSON objects. Validation is performed at the engine level.
username: "hacker101",
is_active: true
});
db.table("user").where(user => user.id == 5).update({
is_active: false
});
Advanced Filtering & Scopes
Perform counts, checks, limit rows, and execute shortcuts with fast Javascript lambda filtering options.
const topUsers = db.limit(3).list(u => u.id > 5);
// 2. Existence verification
const exists = db.exists(u => u.username == "grace");
// 3. Counts based on filters
const activeCount = db.count(u => u.is_active == true);
Database Joins & Raw Queries
Link separate tables together with high-performance joins, or escape to raw SQL when running complex database operations.
const orders = db.join((order, user) => order.user_id == user.id).list();
// 2. Raw query output string
const rawSql = db.table("user").where(u => u.username == "alice%").Raw();
Database Transactions & Safety
Every query runs parameter bindings automatically to block injection vectors. Run isolated mutations inside safe execution scopes.
const userInput = "admin' OR 1=1--";
db.table("user").find("username", userInput);
// Generates prepared query: SELECT * FROM "user" WHERE username = $1
Postgres Driver Configuration
Define your database server connection details inside the central application configuration keys.
type: "postgres"
host: "152.42.253.164" # DB server address
port: 5432
user: "postgres"
password: "kitwork@123"
name: "master"
ssl: "require"