Skip to content

Welcome to No ORM

Like what you’ve seen so far?

This guide will show you how you can get started with no-orm as quickly as possible!

Since no-orm is a code-generator tool, we install no-orm as a dev-dependency.

Terminal window
npm install --save-dev no-orm

It is crucial however that you install these peer-dependencies.

Terminal window
npm install --save slonik zod

Here is a minimal config file:

no-orm-config.ts
import { Config } from "no-orm";
export const config: Config = {
database_url: "postgres://postgres:postgres@localhost:5432/postgres",
};

See the full reference here. (TODO).

Apply the following schema to your database:

penguins.sql
CREATE TABLE penguins (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
species TEXT NOT NULL,
waddle_speed_kph NUMERIC NOT NULL,
favourite_snack TEXT, -- Optional: not all penguins have refined palates.
date_of_birth TIMESTAMP WITH TIME ZONE NOT NULL
);

Run no-orm!

Terminal window
npx no-orm