Function
count
(value: PgColumn | SQLWrapper, alias?: string)
Source from the content-addressed store, hash-verified
| 1931 | function count(value: PgColumn | SQLWrapper): SQL<number>; |
| 1932 | function count(value: PgColumn | SQLWrapper, alias: string): SQL.Aliased<number>; |
| 1933 | function count(value: PgColumn | SQLWrapper, alias?: string): SQL<number> | SQL.Aliased<number> { |
| 1934 | const result = sql`count(${value})`.mapWith(Number); |
| 1935 | if (!alias) { |
| 1936 | return result; |
| 1937 | } |
| 1938 | return result.as(alias); |
| 1939 | } |
| 1940 | |
| 1941 | await db.insert(usersTable).values([{ name: 'John' }, { name: 'Jane' }]); |
| 1942 | |
Callers
nothing calls this directly
Tested by
no test coverage detected