Something went wrong. Try again.
🐿️ Type safe SQL in Gleam
Something went wrong. Try again.
955 B · 37 lines
at custom-types
1234567891011121314151617181920212223242526272829303132333435363738---version: 1.2.5title: array encodingfile: ./test/squirrel_test.gleamtest_name: array_encoding_test---import gleam/dynamic/decodeimport pog/// A row you get from running the `query` query/// defined in `query.sql`.////// > 🐿️ This type definition was generated automatically using v-test of the/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).///pub type QueryRow { QueryRow(res: Bool)}/// Runs the `query` query/// defined in `query.sql`.////// > 🐿️ This function was generated automatically using v-test of/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).///pub fn query(db, arg_1) { let decoder = { use res <- decode.field(0, decode.bool) decode.success(QueryRow(res:)) } "select true as res where $1 = array[1, 2, 3]" |> pog.query |> pog.parameter(pog.array(fn(value) { pog.int(value) }, arg_1)) |> pog.returning(decoder) |> pog.execute(db)}