How to use the cormo.Column 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 / cormo / packages / graphql / src / decorators.ts View on Github external
export function Column(options: {
  enum?: any, type?: cormo.types.ColumnType
  | cormo.types.ColumnType[],
} & IColumnBasicOptions): PropertyDecorator {
  let cormo_type: cormo.types.ColumnType | cormo.types.ColumnType[];
  if (options.enum) {
    cormo_type = cormo.types.Integer;
  } else {
    cormo_type = options.type!;
  }
  const c = cormo.Column({
    _graphql: {
      description: options.description,
    },
    default_value: options.default_value,
    name: options.name,
    required: options.required,
    type: cormo_type,
    unique: options.unique,
  });
  return (target: object, propertyKey: string | symbol) => {
    c(target, propertyKey);
  };
}

cormo

ORM framework for Node.js

MIT
Latest version published 19 days ago

Package Health Score

70 / 100
Full package analysis

Similar packages