Skip to content

postgrelize / Utils

Variable: Utils ​

const Utils: Readonly<{ Cast: typeof Cast; Col: typeof Col; Fn: typeof Fn; Json: typeof Json; Literal: typeof Literal; pluralize: (word) => string; SequelizeMethod: typeof SqlExpression; singularize: (word) => string; useInflection: (custom) => void; Where: typeof Where; }>

Defined in: src/utils-namespace.ts:24

The part of Sequelize v6 Utils that has a postgrelize counterpart: the expression classes behind fn, col, cast, literal, json and where (Utils.Fn, Utils.Literal, ... both as values and as types), SequelizeMethod (the base class of expressions), useInflection, pluralize and singularize. The other v6 helpers are internal and not provided.

Example ​

ts
const isLiteral = (value: unknown): value is Utils.Literal => value instanceof Utils.Literal;
const amount: Utils.Literal = literal('1 + 1');

Released under the MIT License.