Reference

API Reference

Core ExoQuery API types and functions

Core Types

  • SqlQuery<T> - Represents a SQL query that returns a result of type T
  • SqlExpression<T> - Represents a SQL expression of type T
  • SqlAction<T, R> - Represents a SQL action (INSERT, UPDATE, DELETE) that operates on type T and returns R
  • SqlCompiledQuery<T> - A compiled query ready to be executed
  • SqlCompiledAction<T, R> - A compiled action ready to be executed

Main Functions

  • sql { ... } - Create a SQL query or action
  • sql.select { ... } - Create a SQL select query with joins and grouping
  • sql.expression { ... } - Create a SQL expression
  • Table<T>() - Create a table reference
  • param(value) - Pass a runtime parameter to a query
  • params(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