How to use the cormo.BaseModel function in cormo

To help you get started, we’ve selected a few cormo examples, based on popular ways it is used in public projects.

github croquiscom / graphql-project-sample / services / user / app / models / index.ts View on Github external
import 'reflect-metadata';

import * as cormo from 'cormo';

cormo.BaseModel.lean_query = true;

import { connection_user } from './connection_user';
export { connection_user };

export * from './User';

export async function checkSchemas() {
  if (await connection_user.isApplyingSchemasNecessary()) {
    throw new Error(`need to migrate: run 'npm run migrate'`);
  }
}

export async function applySchemas(verbose = false) {
  await connection_user.applySchemas({ verbose });
}

cormo

ORM framework for Node.js

MIT
Latest version published 19 days ago

Package Health Score

70 / 100
Full package analysis

Similar packages