Repository navigation
Releases
v0.2.0: Milestone 2 (auth, APIs and a generated server)
Rizo Lang can now describe a complete backend. A .rz file with an auth line and api blocks compiles to a PostgreSQL schema, TypeScript types and a ready-to-run Node.js server, with login, validation and ownership checks built in.
Rizo Lang is in early development. Expect the language to change before 1.0.
auth User by email
model Post {
author: User
title: Text max 200
published: Bool
}
api POST /posts -> Post.public {
requires login
return db.Post.create(body, author = me)
}
api DELETE /posts/:id {
requires login
requires owner author
return db.Post.delete(id)
}
New in the language
auth User by email: signup, login, logout and/auth/me.- Server-side sessions use hashed tokens in an
HttpOnly; Secure; SameSite=Laxcookie. - Passwords are hashed with scrypt.
- Login and signup are rate-limited.
- Server-side sessions use hashed tokens in an
apiblocks:- Access rules:
publicorrequires login, plusrequires owner <link>. - Queries:
find,list(with filters, order and limit),create,updateanddelete.
- Access rules:
- Links between models:
author: Useris stored as a foreign key. privatefields: stored, but never returned by any endpoint.
Secure by construction
The compiler rejects these mistakes:
- an endpoint that doesn't say whether it is
publicorrequires login, - returning anything other than a
.publicview, - letting the client choose a record's owner (owners are always
me, the logged-in user), - updating or deleting a user's record without
requires owner, - a
GETendpoint that changes data.
What the generated server does:
- All SQL is written at compile time, and requests only fill
$nparameters. - Input is validated against your models, and unknown fields are rejected.
- An
Origincheck blocks cross-site writes, and strict security headers go on every response. - Logs never contain request bodies, cookies or passwords.
Generated output
dist/ now contains:
schema.sqlandtypes.ts, as before,routes.ts: every endpoint with its SQL written out,server.tsand a smallruntime/,package.jsonandtsconfig.json.
Generated apps depend only on pg. Running them needs Node.js 22.18+ and PostgreSQL 13+.
Upgrading from 0.1.0
- A comma after a field is now reported as RZ0212 instead of RZ0101.
- The compiler's entry point moved to
build/src/bin.js. - New error codes RZ0213–RZ0218 and RZ0316–RZ0331 are listed in the spec.
Try it
git clone https://github.com/chaitanyaaggarwal9/rizolang.git
cd rizolang && git checkout v0.2.0
npm ci && npm run build
node build/src/bin.js build examples/blog.rzThen follow Getting started to run the server. Rizo Lang is not on npm yet.
Full changelog: v0.1.0...v0.2.0
v0.1.0: Milestone 1 (models)
The first release of Rizo Lang: model blocks compile to a PostgreSQL schema and TypeScript types.
Rizo Lang is in early development. Only
modelblocks are supported;apiand frontend blocks are planned.
Highlights
- Seven field types:
Text,Number,Bool,Email,Password,Date,ID. - Four modifiers:
unique,optional,min,max. rizolang build app.rzwrites two files:dist/schema.sql: PostgreSQL 13+, withNOT NULL,UNIQUEandCHECKconstraints.dist/types.ts: three types per model.
- Passwords are never exposed:
- They're stored only in
<field>_hashcolumns. - They never appear in
Model.publictypes. - A field named like a password must use the
Passwordtype.
- They're stored only in
- Every error is actionable: an
RZxxxxcode,file:line:col, a source excerpt and a concretefix:line. - Docs written for AI:
- docs/SPEC.md is the full spec.
- docs/SPEC-COMPACT.md is a short version for system prompts.
- Zero runtime dependencies.
- CI runs on Node 22, 24 and 26, plus a PostgreSQL schema check.
Try it
git clone https://github.com/chaitanyaaggarwal9/rizolang.git
cd rizolang && git checkout v0.1.0
npm ci && npm run build
node build/bin.js build examples/blog.rzRizo Lang is not on npm yet.