RealtimePostgresFilterBuilder

Fluent builder for Postgres Changes filter strings.

Each method appends a single column=operator.value condition. Multiple conditions are combined with commas, which the Realtime server applies as an AND. Use the DSL in RealtimeChannel.postgresChangeFlow — the SDK serializes it to a string automatically — or call build to obtain the string yourself.

The builder mirrors the postgrest-kt filter API (eq, neq, in, like, not, …) for the operators that Realtime supports. Values containing reserved characters (,, (, ), ", \) — or surrounding whitespace — are automatically double-quoted and escaped the same way PostgREST does, so they survive the server's filter parser; all other values are sent verbatim.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun build(): String

Serialize all conditions into the comma-separated (AND) filter string.

Link copied to clipboard
fun eq(column: String, value: Any)

Match rows where column equals value (column=eq.value).

Link copied to clipboard
fun exact(column: String, value: Any)

Match rows where column IS the given value (column=is.null). Accepts null, a boolean, or the keywords 'null' | 'true' | 'false' | 'unknown'.

Link copied to clipboard
fun gt(column: String, value: Any)

Match rows where column is greater than value (column=gt.value).

Link copied to clipboard
fun gte(column: String, value: Any)

Match rows where column is greater than or equal to value (column=gte.value).

Link copied to clipboard
fun ilike(column: String, pattern: String)

Match rows where column matches the case-insensitive pattern (column=ilike.pattern).

Link copied to clipboard
fun imatch(column: String, pattern: String)

Match rows where column matches the case-insensitive POSIX regex pattern (column=imatch.pattern).

Link copied to clipboard
fun isDistinct(column: String, value: Any)

Match rows where column is distinct from value (column=isdistinct.value). NULL-safe inequality.

Link copied to clipboard
fun isIn(column: String, values: List<Any>)

Match rows where column is one of values (column=in.(a,b,c)). Requires at least one value; duplicates are removed. An element containing a reserved character is double-quoted (in.("a,b",c)), so commas inside an element are preserved. null is intentionally not accepted (IN (null) never matches in SQL) — use is/not('col','is',null) for null checks.

Link copied to clipboard
fun like(column: String, pattern: String)

Match rows where column matches the case-sensitive pattern (column=like.pattern).

Link copied to clipboard
fun lt(column: String, value: Any)

Match rows where column is less than value (column=lt.value).

Link copied to clipboard
fun lte(column: String, value: Any)

Match rows where column is less than or equal to value (column=lte.value).

Link copied to clipboard
fun match(column: String, pattern: String)

Match rows where column matches the POSIX regex pattern (column=match.pattern).

Link copied to clipboard
fun neq(column: String, value: Any)

Match rows where column does not equal value (column=neq.value).

Link copied to clipboard
fun not(column: String, operator: RealtimePostgresChangesFilterOperator, value: Any)

Negate any operator with the not. prefix (column=not.operator.value). in takes an array, is takes an IS keyword/boolean/null, and every other operator takes a scalar value.