Module

x/justaos_orm/mod.ts>ORM

JUSTAOS's ORM (Object–relational mapping) tool is built for Deno and provides transparent persistence for JavaScript objects to Postgres database.
Go to Latest
class ORM
import { ORM } from "https://dotland.deno.dev/x/justaos_orm@v6.4.0/mod.ts";

JUSTAOS's ORM (Object Document Mapper) is built for Deno and provides transparent persistence for JavaScript objects to Postgres database.

  • Supports all primitive data types (string, integer, float, boolean, date, object, array, etc).
  • Supports custom data types.
  • Supports table with multi-level inheritance.
  • Also supports interception on operations (create, read, update and delete).

Examples

Get connection to database

import {ORM} from "https://deno.land/x/justaos_odm@$VERSION/mod.ts";
const odm = new ORM({
 hostname: "localhost",
 port: 5432,
 username: "postgres",
 password: "postgres"
});
odm.connect();

Constructors

new
ORM(config: DatabaseConfiguration, logger?: Logger)

Methods

addDataType(dataType: DataType): void
addInterceptor(operationInterceptor: DatabaseOperationInterceptor): void
connect(createDatabaseIfNotExists?: boolean): Promise<ORMConnection>
deleteInterceptor(operationInterceptorName: string): void
getTableSchema(tableName: string): TableSchema | undefined
isDatabaseExist(): Promise<boolean>
isTableDefined(tableName: string): boolean
import ORM
import { ORM } from "https://dotland.deno.dev/x/justaos_orm@v6.4.0/mod.ts";