Liking cljdoc? Tell your friends :D

supabase.postgrest.encode

Pre-encoders for complex PostgreSQL column types, for use as filter values or RPC arguments. These render the literal forms PostgREST expects; PostgREST itself validates them server-side.

Example

(require '[supabase.postgrest :as pg]
         '[supabase.postgrest.encode :as enc])

(-> (pg/from c "reservations")
    (pg/eq "during" (enc/pg-range start end))
    (pg/contains "tags" (enc/pg-array ["vip" "weekend"]))
    (pg/execute))
Pre-encoders for complex PostgreSQL column types, for use as filter
values or RPC arguments. These render the literal forms PostgREST expects;
PostgREST itself validates them server-side.

## Example

    (require '[supabase.postgrest :as pg]
             '[supabase.postgrest.encode :as enc])

    (-> (pg/from c "reservations")
        (pg/eq "during" (enc/pg-range start end))
        (pg/contains "tags" (enc/pg-array ["vip" "weekend"]))
        (pg/execute))
raw docstring

->isoclj

(->iso t)

Encodes a timestamp as ISO-8601. Accepts java.time.Instant, java.util.Date, or a string (passed through).

Encodes a timestamp as ISO-8601. Accepts `java.time.Instant`,
`java.util.Date`, or a string (passed through).
sourceraw docstring

pg-arrayclj

(pg-array xs)

Encodes xs as a PostgreSQL array literal: {a,b,c}. Elements with special characters are quoted; nil elements become NULL.

Encodes `xs` as a PostgreSQL array literal: `{a,b,c}`. Elements with
special characters are quoted; `nil` elements become `NULL`.
sourceraw docstring

pg-boolclj

(pg-bool b)

Encodes a boolean as "true"/"false", for is-style filters.

Encodes a boolean as `"true"`/`"false"`, for `is`-style filters.
sourceraw docstring

pg-rangeclj

(pg-range lo hi)
(pg-range lo hi bounds)

Encodes a range literal. Default bounds [lo,hi) (inclusive low, exclusive high); pass bounds as one of "[)", "[]", "()", "(]". Either endpoint may be nil for an unbounded side. Timestamp endpoints are coerced via ->iso.

Encodes a range literal. Default bounds `[lo,hi)` (inclusive low,
exclusive high); pass `bounds` as one of `"[)"`, `"[]"`, `"()"`,
`"(]"`. Either endpoint may be `nil` for an unbounded side. Timestamp
endpoints are coerced via [[->iso]].
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close