/opt/canhelp/node_modules/drizzle-orm/sql/functions
NameSizeModeActions
aggregate.cjs24080644editdlrm
aggregate.cjs.map47580644editdlrm
aggregate.d.cts32600644editdlrm
aggregate.d.ts32580644editdlrm
aggregate.js10280644editdlrm
aggregate.js.map46830644editdlrm
index.cjs12290644editdlrm
index.cjs.map2320644editdlrm
index.d.cts630644editdlrm
index.d.ts610644editdlrm
index.js940644editdlrm
index.js.map1930644editdlrm
vector.cjs25440644editdlrm
vector.cjs.map66540644editdlrm
vector.d.cts45400644editdlrm
vector.d.ts45370644editdlrm
vector.js12000644editdlrm
vector.js.map65790644editdlrm
Edit: /opt/canhelp/node_modules/drizzle-orm/sql/functions/aggregate.d.cts (3260B)
import { type AnyColumn } from "../../column.cjs"; import { type SQL, type SQLWrapper } from "../sql.cjs"; /** * Returns the number of values in `expression`. * * ## Examples * * ```ts * // Number employees with null values * db.select({ value: count() }).from(employees) * // Number of employees where `name` is not null * db.select({ value: count(employees.name) }).from(employees) * ``` * * @see countDistinct to get the number of non-duplicate values in `expression` */ export declare function count(expression?: SQLWrapper): SQL; /** * Returns the number of non-duplicate values in `expression`. * * ## Examples * * ```ts * // Number of employees where `name` is distinct * db.select({ value: countDistinct(employees.name) }).from(employees) * ``` * * @see count to get the number of values in `expression`, including duplicates */ export declare function countDistinct(expression: SQLWrapper): SQL; /** * Returns the average (arithmetic mean) of all non-null values in `expression`. * * ## Examples * * ```ts * // Average salary of an employee * db.select({ value: avg(employees.salary) }).from(employees) * ``` * * @see avgDistinct to get the average of all non-null and non-duplicate values in `expression` */ export declare function avg(expression: SQLWrapper): SQL; /** * Returns the average (arithmetic mean) of all non-null and non-duplicate values in `expression`. * * ## Examples * * ```ts * // Average salary of an employee where `salary` is distinct * db.select({ value: avgDistinct(employees.salary) }).from(employees) * ``` * * @see avg to get the average of all non-null values in `expression`, including duplicates */ export declare function avgDistinct(expression: SQLWrapper): SQL; /** * Returns the sum of all non-null values in `expression`. * * ## Examples * * ```ts * // Sum of every employee's salary * db.select({ value: sum(employees.salary) }).from(employees) * ``` * * @see sumDistinct to get the sum of all non-null and non-duplicate values in `expression` */ export declare function sum(expression: SQLWrapper): SQL; /** * Returns the sum of all non-null and non-duplicate values in `expression`. * * ## Examples * * ```ts * // Sum of every employee's salary where `salary` is distinct (no duplicates) * db.select({ value: sumDistinct(employees.salary) }).from(employees) * ``` * * @see sum to get the sum of all non-null values in `expression`, including duplicates */ export declare function sumDistinct(expression: SQLWrapper): SQL; /** * Returns the maximum value in `expression`. * * ## Examples * * ```ts * // The employee with the highest salary * db.select({ value: max(employees.salary) }).from(employees) * ``` */ export declare function max(expression: T): SQL<(T extends AnyColumn ? T['_']['data'] : string) | null>; /** * Returns the minimum value in `expression`. * * ## Examples * * ```ts * // The employee with the lowest salary * db.select({ value: min(employees.salary) }).from(employees) * ``` */ export declare function min(expression: T): SQL<(T extends AnyColumn ? T['_']['data'] : string) | null>;