UNPKG

quaerateum

Version:

Simple typescript ORM for node.js based on data-mapper, unit-of-work and identity-map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JS.

22 lines (14 loc) 344 B
import { Entity, IEntity, PrimaryKey, Property } from '../../lib'; @Entity() export class Test { @PrimaryKey({ type: 'ObjectID' }) _id: any; @Property({ type: 'string' }) name: any; static create(name: string) { const t = new Test(); t.name = name; return t; } } export interface Test extends IEntity<string> { }