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!
Installation
Section titled “Installation”Since no-orm
is a code-generator tool, we install no-orm
as a dev-dependency.
npm install --save-dev no-orm
It is crucial however that you install these peer-dependencies.
npm install --save slonik zod
Initialise your config file
Section titled “Initialise your config file”Here is a minimal config file:
import { Config } from "no-orm";
export const config: Config = { database_url: "postgres://postgres:postgres@localhost:5432/postgres",};
See the full reference here. (TODO).
Your first auto-generated code
Section titled “Your first auto-generated code”Apply the following schema to your database:
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
!
npx no-orm