Skip to content

Releases

v0.2.0: Milestone 2 (auth, APIs and a generated server)

Choose a tag to compare

@chaitanyaaggarwal9 chaitanyaaggarwal9 released this 21 Nov 03:29
b80e268

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=Lax cookie.
    • Passwords are hashed with scrypt.
    • Login and signup are rate-limited.
  • api blocks:
    • Access rules: public or requires login, plus requires owner <link>.
    • Queries: find, list (with filters, order and limit), create, update and delete.
  • Links between models: author: User is stored as a foreign key.
  • private fields: stored, but never returned by any endpoint.

Secure by construction

The compiler rejects these mistakes:

  • an endpoint that doesn't say whether it is public or requires login,
  • returning anything other than a .public view,
  • 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 GET endpoint that changes data.

What the generated server does:

  • All SQL is written at compile time, and requests only fill $n parameters.
  • Input is validated against your models, and unknown fields are rejected.
  • An Origin check 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.sql and types.ts, as before,
  • routes.ts: every endpoint with its SQL written out,
  • server.ts and a small runtime/,
  • package.json and tsconfig.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.rz

Then 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)

Pre-release

Choose a tag to compare

@chaitanyaaggarwal9 chaitanyaaggarwal9 released this 21 Nov 02:57
e6b2934

The first release of Rizo Lang: model blocks compile to a PostgreSQL schema and TypeScript types.

Rizo Lang is in early development. Only model blocks are supported; api and frontend blocks are planned.

Highlights

  • Seven field types: Text, Number, Bool, Email, Password, Date, ID.
  • Four modifiers: unique, optional, min, max.
  • rizolang build app.rz writes two files:
    • dist/schema.sql: PostgreSQL 13+, with NOT NULL, UNIQUE and CHECK constraints.
    • dist/types.ts: three types per model.
  • Passwords are never exposed:
    • They're stored only in <field>_hash columns.
    • They never appear in Model.public types.
    • A field named like a password must use the Password type.
  • Every error is actionable: an RZxxxx code, file:line:col, a source excerpt and a concrete fix: line.
  • Docs written for AI:
  • 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.rz

Rizo Lang is not on npm yet.