🐿️ Type safe SQL in Gleam
0

Configure Feed

Select the types of activity you want to include in your feed.

squirrel / test / birdie_snapshots / citext_encoding.accepted
576 B 30 lines
1--- 2version: 2.0.0 3title: citext encoding 4file: ./test/squirrel_test.gleam 5test_name: citext_encoding_test 6--- 7 8import gleam/dynamic/decode 9import pog 10 11pub type QueryRow { 12 QueryRow(res: Bool) 13} 14 15pub fn query( 16 connection: pog.Connection, 17 arg_1: String, 18) -> Result(pog.Returned(QueryRow), pog.QueryError) { 19 let decoder = { 20 use res <- decode.field(0, decode.bool) 21 decode.success(QueryRow(res:)) 22 } 23 24 "select true as res where $1 = 'wibble'::citext" 25 |> pog.query 26 |> pog.parameter(pog.text(arg_1)) 27 |> pog.returning(decoder) 28 |> pog.execute(connection) 29} 30