UNPKG

pure-orm

Version:

A SQL Toolkit based on pure business objects passed to and from stateful data access objects

33 lines (26 loc) 617 B
import { IModel, ICollection, IColumns } from '../../../src/index'; import { Person } from './person'; export const tableName = 'tag'; export const columns: IColumns = ['id', 'name', 'slug']; export class Tag implements IModel { id: number; name: string; slug: string; constructor(props: any) { this.id = props.id; this.name = props.name; this.slug = props.slug; } } export class Tags implements ICollection<Tag> { models: Array<Tag>; constructor({ models }: any) { this.models = models; } } export const tagEntity = { tableName, columns, Model: Tag, Collection: Tags };