Function
count
(value: PgColumn | SQLWrapper, alias?: string)
Source from the content-addressed store, hash-verified
| 2152 | function count(value: PgColumn | SQLWrapper): SQL<number>; |
| 2153 | function count(value: PgColumn | SQLWrapper, alias: string): SQL.Aliased<number>; |
| 2154 | function count(value: PgColumn | SQLWrapper, alias?: string): SQL<number> | SQL.Aliased<number> { |
| 2155 | const result = sql`count(${value})`.mapWith(Number); |
| 2156 | if (!alias) { |
| 2157 | return result; |
| 2158 | } |
| 2159 | return result.as(alias); |
| 2160 | } |
| 2161 | |
| 2162 | await db.insert(usersTable).values([{ name: 'John' }, { name: 'Jane' }]); |
| 2163 | |
Callers
nothing calls this directly
Tested by
no test coverage detected