postgrelize / col
Function: col() ​
col(
name):Col
Defined in: src/expressions/methods.ts:73
Creates a column reference. Dots separate table and column: 'user.id'.
Parameters ​
name ​
string
Column name, optionally prefixed with a table alias.
Returns ​
Column expression.
Example ​
ts
await Post.findAll({ attributes: [[fn('count', col('Post.id')), 'total']], group: [col('Post.userId')] });