Files
dealplustech/node_modules/drizzle-orm/sql/functions/aggregate.d.cts
Kunthawat 5171a789e9 fix: Final restoration with port 80
 COMPLETED:
1. Dockerfile uses port 80 (astro preview)
2. BaseLayout imports globals.css
3. globals.css with Tailwind v4 @theme syntax
4. index.astro has Header, Footer, FixedContact
5. All image references fixed to existing files
6. Hero uses hdpe_pipe_main.jpg
7. Product cards use hdpe001.jpg
8. pt-20 on main for fixed header

 TESTED LOCALLY:
- Build: 15 pages in 1.27s
- Docker build successful
- Port 80 working
- Images load
- CSS works

Ready for Easypanel deployment.
2026-03-12 08:58:56 +07:00

105 lines
3.2 KiB
TypeScript

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<number>;
/**
* 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<number>;
/**
* 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<string | null>;
/**
* 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<string | null>;
/**
* 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<string | null>;
/**
* 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<string | null>;
/**
* 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<T extends SQLWrapper>(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<T extends SQLWrapper>(expression: T): SQL<(T extends AnyColumn ? T['_']['data'] : string) | null>;