Skip to content

Docs Reference

Supported query operators

The app client's from(table) builder speaks the query language of supabase-js, and it answers every call from the device's local database. This page lists each method of postgrest-js 2.117.2, the query builder inside supabase-js, with its status in the JavaScript, Swift, and Kotlin app clients.

A supported method keeps the meaning Supabase documents for it. The Rust kernel evaluates it over the rows earlier pulls delivered and the writes this device made, with the local differences each method's reference page lists, and a write applies locally before it waits in the outbox for the next push. An unsupported method throws LOCAL_UNSUPPORTED with the reason in its message, and no call falls back to the network.

Methods#

In the three platform columns, Yes means the client runs the method locally. No means the method exists and throws LOCAL_UNSUPPORTED: JavaScript throws when you call it, and Swift and Kotlin throw when the chain runs. A dash means the client has no method of that name. Notes give the Swift or Kotlin name where it differs, and for a refused method the reason its error message carries. Each supported method links to its JavaScript reference entry.

MethodJavaScriptSwiftKotlinNotes
abortSignalYes——Reads only. A read whose signal aborts before it settles rejects with the signal's reason. An update or a delete refuses it, because a local write is applied at once and cannot be aborted.
containedByYesYesYesContainment with the two sides swapped, over JSON-string, array, and scalar cells.
containsYesYesYesLocal containment over JSON-string, array, and scalar cells, standing in for the Postgres @> operator.
csvYesYesYesReads only. Returns the rows as CSV text. An update or a delete refuses it, because csv() formats a read, not a write.
deleteYesYesYesNeeds a filter that names rows. On a table with a soft-delete column it stamps that column instead of removing the row. A pull-only table refuses it.
eqYesYesYesA null cell or a null argument never matches, as = NULL in SQL.
explainNoNoNoLOCAL_UNSUPPORTED: EXPLAIN describes the server query planner.
filterYesYesYesOne column.operator.value clause in the grammar or accepts, the not. prefix included.
fromYesYesYesOpens the builder of one synced table. A table missing from the client's config throws UNKNOWN_TABLE.
geojsonNoNoNoLOCAL_UNSUPPORTED: PostGIS output has no local representation.
getOpenApiSpecNo——LOCAL_UNSUPPORTED: the OpenAPI spec is server metadata.
gtYesYesYesGreater than.
gteYesYesYesGreater than or equal.
ilikeYesYesYesThe like grammar, case-insensitive.
ilikeAllOfYesYesYesEvery pattern must match, case-insensitive. Swift iLikeAllOf, Kotlin ilikeAll.
ilikeAnyOfYesYesYesAny pattern may match, case-insensitive. Swift iLikeAnyOf, Kotlin ilikeAny.
inYesYesYesMembership in a list. A null cell never matches. Kotlin inValues.
insertYesYesYesWrites the row locally and queues it for the next push. JavaScript chains select() after it to read the row back, while the Swift and Kotlin insert returns nothing. A pull-only table refuses it.
isYesYesYesnull, true, or false only. Kotlin isValue.
isDistinctYesYesYesIS DISTINCT FROM, which treats null as a value.
likeYesYesYesSQL LIKE patterns with % and _, anchored at both ends.
likeAllOfYesYesYesEvery pattern must match. Kotlin likeAll.
likeAnyOfYesYesYesAny pattern may match. Kotlin likeAny.
limitYesYesYesKeeps the first rows after the sort.
ltYesYesYesLess than.
lteYesYesYesLess than or equal.
matchYesYesYeseq on every key, combined with AND. A write refuses an empty object, because it names no rows.
maxAffectedYesYesYesUpdates and deletes. When the filters match more rows than the cap, nothing is written and the call throws LOCAL_CONSTRAINT. A read refuses it, because maxAffected() caps an update or a delete, not a read.
maybeSingleYesYesYesZero rows or one. More than one throws LOCAL_CONSTRAINT.
neqYesYesYesInequality. A null cell never matches.
notYesYesYesNegates one clause. Swift and Kotlin take a filter node instead of a column, an operator, and a value.
notInYesYesYesSQL NOT IN, with its null handling.
orYesYesYesJavaScript decodes the PostgREST clause string on the device and refuses a nested or or and inside it. Swift and Kotlin take a list of filter nodes.
orderYesYesYesNulls sort last ascending and first descending, as in Postgres, unless nullsFirst says otherwise.
overlapsYesYesYesArray overlap. A range literal such as '[1,5)' throws LOCAL_UNSUPPORTED, because Postgres range types have no local representation.
overrideTypesYes——Changes the static type only. An update or a delete refuses it until select() follows, because a write without select() has no rows to type.
rangeYesYesYesReads only. Keeps an inclusive window of rows after the sort. An update or a delete refuses it, because a write has no row window to page.
rangeAdjacentNo——LOCAL_UNSUPPORTED: Postgres range types have no local representation.
rangeGtNo——LOCAL_UNSUPPORTED: Postgres range types have no local representation.
rangeGteNo——LOCAL_UNSUPPORTED: Postgres range types have no local representation.
rangeLtNo——LOCAL_UNSUPPORTED: Postgres range types have no local representation.
rangeLteNo——LOCAL_UNSUPPORTED: Postgres range types have no local representation.
regexIMatchYesYesYesPostgres ~*, the case-insensitive regexMatch. Swift imatch.
regexMatchYesYesYesPostgres ~, evaluated by the Rust regex crate. A pattern it cannot compile, such as one with a backreference or a lookaround, throws LOCAL_UNSUPPORTED naming the pattern. Swift match(_:pattern:).
retryYesYesYesNo effect, because a local read or write makes no network attempt to retry.
returnsYes——Changes the static type only. An update or a delete refuses it until select() follows, because a write without select() has no rows to type.
rollbackNoNoNoLOCAL_UNSUPPORTED: there is no server transaction to roll back; local writes enter the outbox. Swift and Kotlin dryRun.
rpcNo——LOCAL_UNSUPPORTED: rpc() runs a server function; call it through supabase-js when online. JavaScript refuses it on the app client and after from().
schemaNo——LOCAL_UNSUPPORTED: synced tables are addressed by name.
selectYesYesYesA column projection, applied when the read runs. After an update or a delete it returns the rows the write reached. The options below cover counts, embeds, and renames.
setHeaderNoNo—LOCAL_UNSUPPORTED: a local read or write sends no HTTP request.
singleYesYesYesExactly one row. Zero rows or more than one throw LOCAL_CONSTRAINT.
stripNullsYesYesYesDrops the null-valued keys of each row. An update or a delete refuses it until select() follows, because a write without select() has no rows to strip.
textSearchYesYesYesReads only. A local stand-in for full-text search over one column, with the plain, phrase, and websearch types.
throwOnErrorYes——No effect, because a local read or write already throws on error.
updateYesYesYesNeeds a filter that names rows, and never changes a column of the row key. A pull-only table refuses it.
upsertNo——LOCAL_UNSUPPORTED: an offline device cannot know whether the server holds the row; use insert or update.

Options#

The same columns apply to the options postgrest-js methods take.

OptionJavaScriptSwiftKotlinNotes
select countYesYesYesReturns how many rows the filters match before range and limit. The kernel counts every match, so exact, planned, and estimated all return the exact local count.
select headYesYesYesReturns the count without the rows.
insert countYes——Returns 1, the one row written.
update and delete countYes——Returns the number of rows the write reached.
insert defaultToNullNo——LOCAL_UNSUPPORTED: the push sends only the columns written and the database fills defaults.
upsert onConflict and ignoreDuplicatesNo——LOCAL_UNSUPPORTED on insert as well: it belongs to upsert(), which the local store does not offer.
referencedTable and its alias foreignTableNo——LOCAL_UNSUPPORTED on order, limit, range, or, and textSearch: the local store holds each synced table without foreign-key joins; read related rows with a second query.
Relational embeds in selectNoNoNoLOCAL_UNSUPPORTED: relational embeds are not supported locally; the local store holds each synced table without foreign-key joins, so read related rows with a second query.
Renames in selectNoNoNoLOCAL_UNSUPPORTED: renames are not supported locally.

Kizuna additions#

Three methods have no postgrest-js counterpart.

AdditionJavaScriptSwiftKotlinNotes
andYesYesYesEvery clause must match. JavaScript takes the clause string or takes, and Swift and Kotlin take a list of filter nodes.
searchYesYesYesReads only. A case-insensitive substring search across every string and number column, or across the columns you name.
includeDeletedYesYesYesKeeps the rows a table's soft-delete column marks. JavaScript offers it on reads and writes, and Swift and Kotlin on reads.

Found a problem? Edit this page on GitHub