🐿️ Type safe SQL in Gleam
834 B
35 lines
1---
2version: 1.1.8
3title: query with comment
4file: ./test/squirrel_test.gleam
5test_name: query_with_comment_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/// This is a comment
18///
19/// > 🐿️ This function was generated automatically using v-test of
20/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
21///
22pub fn query(db) {
23 let decoder =
24 decode.into({
25 use res <- decode.parameter
26 QueryRow(res: res)
27 })
28 |> decode.field(0, decode.bool)
29
30 "
31-- This is a comment
32select true as res
33"
34 |> pgo.execute(db, [], decode.from(decoder, _))
35}