OptionalschemaSchema to use for the table
OptionalattributesOptionalwhereOptionalincludeOptionalorderOptionallimitOptionaloffsetOptionalgroupOptionalhavingOptionalrawOptionallockOptionalsubOptionalbenchmarkOptionaldistinctOptionalcolColumn to use with DISTINCT for count queries (e.g., COUNT(DISTINCT col))
OptionaldistinctOptionalduplicateWhen true, uses table aliases to distinguish duplicate column names This is needed when including multiple tables that have columns with the same name
OptionalunionUNION type for combining multiple queries
OptionalunionArray of union queries to combine with the main query
OptionalcteCommon Table Expressions (CTEs) to prepend to the query as a WITH clause.
Each entry becomes name [(columns)] AS (query). If any entry sets
recursive: true, the whole clause is emitted as WITH RECURSIVE.
OptionalsamplePostgreSQL TABLESAMPLE clause, appended right after the FROM table:
FROM table TABLESAMPLE BERNOULLI(10) REPEATABLE(seed). percent is the
sampling percentage (0-100). seed, if provided, produces a repeatable
sample via REPEATABLE(seed).
Everything a
SELECTcan carry once associations have been resolved: columns, joins, filtering, grouping, ordering, pagination and locking. This is the dialect-facing form ofFindOptions.