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.

21 lines (13 loc) 364 B
import { IEntity, PrimaryKey, Property } from '../../lib'; import { ObjectID } from 'bson'; export abstract class BaseEntity { @PrimaryKey() _id: ObjectID; @Property() createdAt = new Date(); @Property({ onUpdate: () => new Date() }) updatedAt = new Date(); @Property() foo: string; } export interface BaseEntity extends IEntity<string> { }