168using namespace query::literals;
auto current_timestamp()
CURRENT_TIMESTAMP function - returns the current timestamp.
auto start_of_day(const T &date_column)
Get the start of the day for a date.
auto min(Expr expr)
MIN aggregate function.
auto current_time()
CURRENT_TIME function - returns the current time.
auto second(const T &date_column)
Get the second from a timestamp.
auto age_in_years(const T &birth_date_column)
Calculate age in years between birth date and current date.
auto like(Expr expr, std::string pattern)
Create a LIKE condition.
auto avg(Expr expr)
AVG aggregate function.
auto hour(const T &date_column)
Get the hour from a timestamp.
auto interval(std::string_view interval_str)
Create an interval expression.
auto start_of_month(const T &date_column)
Get the start of the month for a date.
auto asc(Expr expr)
Create an ascending order by expression.
auto start_of_year(const T &date_column)
Get the start of the year for a date.
auto year(const T &date_column)
Get the year from a date.
auto in(const schema::column< TableT, Name, T, Modifiers... > &col, Range values)
Create an IN condition with type checking for columns.
auto month(const T &date_column)
Get the month from a date.
auto day_of_year(const T &date_column)
Get the day of year from a date (1-366)
auto extract(std::string_view unit, Expr expr)
EXTRACT function - extracts a date part from a date.
auto day(const T &date_column)
Get the day from a date.
auto max(Expr expr)
MAX aggregate function.
auto date_add(DateExpr date_expr, IntervalExpr interval_expr)
DATE_ADD function - adds an interval to a date.
auto sum(Expr expr)
SUM aggregate function.
auto desc(Expr expr)
Create a descending order by expression.
auto update(const Table &table)
Create an UPDATE query for the specified table.
auto as(const Expr &expr, std::string alias)
Create an aliased column expression.
auto select_expr(const schema::column< TableT, Name, T, Modifiers... > &col, Args &&... args)
auto insert_into(const Table &table)
Create an INSERT query for the specified table.
auto minute(const T &date_column)
Get the minute from a timestamp.
auto case_()
Create a CASE expression with type checking.
auto current_date()
CURRENT_DATE function - returns the current date.
auto to_expr(const C &col, std::string_view table_name="")
Helper to wrap a schema column in a SQL expression.
auto count_distinct(Expr expr)
COUNT(DISTINCT expr) aggregate function.
auto count(Expr expr)
COUNT aggregate function.
auto days_until(const T &date_column)
Calculate days until a date.
auto date_trunc(std::string_view unit, Expr expr)
DATE_TRUNC function - truncates a date to specified precision.
auto days_since(const T &date_column)
Calculate days since a date.
auto select(const Args &... args)
Create a column reference from a member pointer without requiring a table instance.
auto delete_from(const Table &table)
Create a DELETE query for the specified table.
auto date_diff(std::string_view unit, Expr1 date1, Expr2 date2)
DATE_DIFF function - calculates difference between two dates.
auto coalesce(First first, Second second, Rest... rest)
Create a COALESCE expression.
auto abs(Expr expr)
ABS function for SQL expressions.
auto distinct(Expr expr)
Create a DISTINCT expression.
auto day_of_week(const T &date_column)
Get the day of week from a date (0=Sunday, 1=Monday, etc.)
auto val(const char *str)
Helper to create a value expression from a string literal.
auto now()
NOW function - alias for CURRENT_TIMESTAMP.
auto to_table(const T &table)
Helper to wrap a schema table in a table adapter.
auto count_all()
COUNT(*) aggregate function.
auto on(Condition cond)
Create a join condition with the ON clause.
auto date_sub(DateExpr date_expr, IntervalExpr interval_expr)
DATE_SUB function - subtracts an interval from a date.