API Reference
Core ExoQuery API types and functions
Core Types
SqlQuery<T>- Represents a SQL query that returns a result of type TSqlExpression<T>- Represents a SQL expression of type TSqlAction<T, R>- Represents a SQL action (INSERT, UPDATE, DELETE) that operates on type T and returns RSqlCompiledQuery<T>- A compiled query ready to be executedSqlCompiledAction<T, R>- A compiled action ready to be executed
Main Functions
sql { ... }- Create a SQL query or actionsql.select { ... }- Create a SQL select query with joins and groupingsql.expression { ... }- Create a SQL expressionTable<T>()- Create a table referenceparam(value)- Pass a runtime parameter to a queryparams(values)- Pass multiple runtime parameters (for IN clauses)
Query Operations
.map { ... }- Project columns (SELECT).filter { ... }- Filter rows (WHERE).where { ... }- Filter rows (WHERE).sortedBy { ... }- Sort results (ORDER BY).sortedByDescending { ... }- Sort results descending (ORDER BY DESC)
Build and Execute
.buildFor.Postgres()- Build query for PostgreSQL.buildFor.Sqlite()- Build query for SQLite.buildFor.SqlServer()- Build query for SQL Server.buildFor.MySql()- Build query for MySQL.runOn(controller)- Execute the query on a database controller