Daita
  • Introduction
  • Getting started
  • Usage
    • relational
      • SELECT
      • INSERT
      • UPDATE
      • DELETE
      • Schema
        • CREATE SCHEMA
      • Table
        • CREATE TABLE
        • ALTER TABLE
        • DROP TABLE
        • LOCK TABLE
      • View
        • CREATE VIEW
        • DROP VIEW
      • Index
        • CREATE INDEX
        • DROP INDEX
      • Functions
        • Aggregation
          • AVG
          • COUNT
          • MAX
          • MIN
          • SUM
        • Conditional
          • CASE WHEN
          • COALESCE
          • GREATEST
          • LEAST
        • Date
          • DAY OF MONTH
          • DAY OF WEEK
          • DAY OF YEAR
          • HOUR
          • MINUTE
          • MONTH
          • NOW
          • SECOND
          • WEEK OF YEAR
          • YEAR
        • Numeric
          • CEIL
          • FLOOR
          • ROUND
        • String
          • CONCAT
    • ORM
    • cli
  • Adapters
    • pg-adapter
    • sqlite-adpater
    • mariadb-adpater
    • http-adpater
Powered by GitBook
On this page

Getting started

npm init @daita
export class Mountain {
  name!: string
  height!: number
}
import { RelationalSchema } from '@daita/orm';
import { Mountain } from './models/mountain';

export const schema = new RelationalSchema('getting-started');
schema.table(Mountain);
npx daita migration:add initial
npx daita migration:apply
PreviousIntroductionNextUsage

Last updated 3 years ago