Skip to content

CountQueryOptions

Defined in: define/table/types/query.ts:78

Defines the options available for a COUNT query.

// Count all active users
const activeUserCount = await User.count({
where: 'isActive = true'
});

TTable

The data shape of the table being queried.

optional groupBy: (string | keyof TTable)[]

Defined in: define/table/types/query.ts:82

An array of fields to group the results by before counting.


optional parallel: boolean

Defined in: define/table/types/query.ts:84

If true, runs the query in parallel with other queries.


optional timeout: string

Defined in: define/table/types/query.ts:86

The timeout for the query, specified in a duration string (e.g. “1m”).


optional where: string

Defined in: define/table/types/query.ts:80

The WHERE clause to filter the records before counting.