postgrelize / ProjectionAlias
Type Alias: ProjectionAlias ​
ProjectionAlias = readonly [
string|Literal|Fn|Col,string]
Defined in: src/model/select-options.ts:15
Aliased attribute [expression, alias] in attributes (Sequelize v6 ProjectionAlias).
Example ​
ts
const total: ProjectionAlias = [fn('count', col('id')), 'total'];
const rows = await Post.findAll({ attributes: ['authorId', total], group: ['authorId'] });