🐿️ Type safe SQL in Gleam
867 B
33 lines
1---
2version: 1.1.8
3title: int encoding
4file: ./test/squirrel_test.gleam
5test_name: int_encoding_test
6---
7/// A row you get from running the `query` query
8/// defined in `query.sql`.
9///
10/// > 🐿️ This type definition was generated automatically using v-test of the
11/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
12///
13pub type QueryRow {
14 QueryRow(res: Bool)
15}
16
17/// Runs the `query` query
18/// defined in `query.sql`.
19///
20/// > 🐿️ This function was generated automatically using v-test of
21/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
22///
23pub fn query(db, arg_1) {
24 let decoder =
25 decode.into({
26 use res <- decode.parameter
27 QueryRow(res: res)
28 })
29 |> decode.field(0, decode.bool)
30
31 "select true as res where $1 = 11"
32 |> pgo.execute(db, [pgo.int(arg_1)], decode.from(decoder, _))
33}