🐿️ Type safe SQL in Gleam
73

Configure Feed

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

reduce snapshots size

Giacomo Cavalieri (Jul 31, 2025, 6:47 PM +0200) e4b8d2df 89e083aa

+48 -982
-17
birdie_snapshots/array_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: array_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: List(Int)) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.list(decode.int))
-17
birdie_snapshots/array_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: array_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/bool_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: bool_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/bool_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: bool_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/bytea_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: bytea_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: BitArray) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bit_array)
-17
birdie_snapshots/bytea_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: bytea_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/char_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: char_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: String) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.string)
-17
birdie_snapshots/char_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: char_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/date_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: date_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/time/calendar.{type Date} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(res: Date) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use res <- decode.field(0, pog.calendar_date_decoder())
-17
birdie_snapshots/date_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: date_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/decode_success_with_long_builder_close_to_80_chars_is_properly_formatted_not_breaking_it_on_a_different_line.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: decode_success_with_long_builder_close_to_80_chars_is_properly_formatted_not_breaking_it_on_a_different_line_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(aaaaaaaa: Int, bbbbbbbbbbbbbbb: Int, ccc: Int, dddddddddddddddd: Int) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use aaaaaaaa <- decode.field(0, decode.int)
-17
birdie_snapshots/decode_success_with_long_builder_is_properly_formatted_not_breaking_it_on_a_different_line.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: decode_success_with_long_builder_is_properly_formatted_not_breaking_it_on_a_different_line_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow( 24 13 first_column: Int, ··· 30 19 ) 31 20 } 32 21 33 - /// Runs the `query` query 34 - /// defined in `query.sql`. 35 - /// 36 - /// > 🐿️ This function was generated automatically using v-test of 37 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 38 - /// 39 22 pub fn query(db) { 40 23 let decoder = { 41 24 use first_column <- decode.field(0, decode.int)
-23
birdie_snapshots/enum_array_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: enum_array_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: List(SquirrelColour)) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.list(squirrel_colour_decoder())) ··· 41 24 |> pog.execute(db) 42 25 } 43 26 44 - // --- Enums ------------------------------------------------------------------- 45 27 46 - /// Corresponds to the Postgres `squirrel_colour` enum. 47 - /// 48 - /// > 🐿️ This type definition was generated automatically using v-test of the 49 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 50 - /// 51 28 pub type SquirrelColour { 52 29 LightBrown 53 30 Grey
-23
birdie_snapshots/enum_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: enum_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(squirrel_colour: SquirrelColour) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use squirrel_colour <- decode.field(0, squirrel_colour_decoder()) ··· 41 24 |> pog.execute(db) 42 25 } 43 26 44 - // --- Enums ------------------------------------------------------------------- 45 27 46 - /// Corresponds to the Postgres `squirrel_colour` enum. 47 - /// 48 - /// > 🐿️ This type definition was generated automatically using v-test of the 49 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 50 - /// 51 28 pub type SquirrelColour { 52 29 LightBrown 53 30 Grey
-23
birdie_snapshots/enum_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: enum_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Int) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.int) ··· 42 25 |> pog.execute(db) 43 26 } 44 27 45 - // --- Enums ------------------------------------------------------------------- 46 28 47 - /// Corresponds to the Postgres `squirrel_colour` enum. 48 - /// 49 - /// > 🐿️ This type definition was generated automatically using v-test of the 50 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 51 - /// 52 29 pub type SquirrelColour { 53 30 LightBrown 54 31 Grey
-17
birdie_snapshots/fields_appear_in_the_order_they_have_in_the_select_list.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: fields_appear_in_the_order_they_have_in_the_select_list_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(first: Bool, second: Int, third: String) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use first <- decode.field(0, decode.bool)
-17
birdie_snapshots/float4_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: float4_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Float) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.float)
-17
birdie_snapshots/float4_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: float4_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/float8_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: float8_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Float) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.float)
-17
birdie_snapshots/float8_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: float8_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/full_join_columns_are_optional.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: full_join_columns_are_optional_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/option.{type Option} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(optional1: Option(String), optional2: Option(String)) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use optional1 <- decode.field(0, decode.optional(decode.string))
-17
birdie_snapshots/generated_type_fields_are_labelled_with_their_name_in_the_select_list.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: generated_type_fields_are_labelled_with_their_name_in_the_select_list_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/option.{type Option} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(acorns: Option(Int), squirrel_name: String) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use acorns <- decode.field(0, decode.optional(decode.int))
-17
birdie_snapshots/generated_type_has_the_same_name_as_the_function_but_in_pascal_case.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: generated_type_has_the_same_name_as_the_function_but_in_pascal_case_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-11
birdie_snapshots/insert_with_no_returned_values_returns_just_nil_and_doesnt_define_a_type.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: insert_with_no_returned_values_returns_just_nil_and_doesnt_define_a_type_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// Runs the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This function was generated automatically using v-test of 20 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub fn query(db) { 23 12 let decoder = decode.map(decode.dynamic, fn(_) { Nil }) 24 13
-17
birdie_snapshots/int_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: int_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Int) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.int)
-17
birdie_snapshots/int_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: int_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/json_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: json_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: String) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.string)
-11
birdie_snapshots/json_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: json_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/json 15 10 import pog 16 11 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 - /// 23 12 pub fn query(db, arg_1) { 24 13 let decoder = decode.map(decode.dynamic, fn(_) { Nil }) 25 14
-17
birdie_snapshots/jsonb_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: jsonb_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: String) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.string)
-11
birdie_snapshots/jsonb_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: jsonb_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/json 15 10 import pog 16 11 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 - /// 23 12 pub fn query(db, arg_1) { 24 13 let decoder = decode.map(decode.dynamic, fn(_) { Nil }) 25 14
-17
birdie_snapshots/left_join_columns_are_optional.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: left_join_columns_are_optional_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/option.{type Option} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(not_optional: String, optional: Option(String)) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use not_optional <- decode.field(0, decode.string)
-17
birdie_snapshots/left_join_nullability_inference.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: left_join_nullability_inference_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/option.{type Option} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(user_id: Int, roles: Option(String)) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use user_id <- decode.field(0, decode.int)
-17
birdie_snapshots/nullability_with_foreign_key.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: nullability_with_foreign_key_condition_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/option.{type Option} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(item_id: Int, name: Option(String)) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db, arg_1) { 34 17 let decoder = { 35 18 use item_id <- decode.field(0, decode.int)
-17
birdie_snapshots/numeric_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: numeric_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Float) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, pog.numeric_decoder())
-17
birdie_snapshots/numeric_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: numeric_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/optional_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: optional_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/option.{type Option} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(acorns: Option(Int)) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use acorns <- decode.field(0, decode.optional(decode.int))
-29
birdie_snapshots/queries_are_sorted_alphabetically.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: queries_are_sorted_alphabetically_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `first` query 17 - /// defined in `first.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type FirstRow { 23 12 FirstRow(wibble: Int) 24 13 } 25 14 26 - /// Runs the `first` query 27 - /// defined in `first.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn first(db) { 33 16 let decoder = { 34 17 use wibble <- decode.field(0, decode.int) ··· 41 24 |> pog.execute(db) 42 25 } 43 26 44 - /// A row you get from running the `last` query 45 - /// defined in `last.sql`. 46 - /// 47 - /// > 🐿️ This type definition was generated automatically using v-test of the 48 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 49 - /// 50 27 pub type LastRow { 51 28 LastRow(wibble: Int) 52 29 } 53 30 54 - /// Runs the `last` query 55 - /// defined in `last.sql`. 56 - /// 57 - /// > 🐿️ This function was generated automatically using v-test of 58 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 59 - /// 60 31 pub fn last(db) { 61 32 let decoder = { 62 33 use wibble <- decode.field(0, decode.int)
-17
birdie_snapshots/query_starting_with_a_semicolon_does_not_crash.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: query_starting_with_a_semicolon_does_not_crash_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(result: Int) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use result <- decode.field(0, decode.int)
-20
birdie_snapshots/query_that_needs_more_than_a_single_helper_function.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: query_that_needs_more_than_a_single_helper_function_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/time/calendar.{type Date} 15 10 import pog 16 11 import youid/uuid.{type Uuid} 17 12 18 - /// A row you get from running the `query` query 19 - /// defined in `query.sql`. 20 - /// 21 - /// > 🐿️ This type definition was generated automatically using v-test of the 22 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 23 - /// 24 13 pub type QueryRow { 25 14 QueryRow(gen_random_uuid: Uuid, date: Date) 26 15 } 27 16 28 - /// Runs the `query` query 29 - /// defined in `query.sql`. 30 - /// 31 - /// > 🐿️ This function was generated automatically using v-test of 32 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 33 - /// 34 17 pub fn query(db) { 35 18 let decoder = { 36 19 use gen_random_uuid <- decode.field(0, uuid_decoder()) ··· 44 27 |> pog.execute(db) 45 28 } 46 29 47 - // --- Encoding/decoding utils ------------------------------------------------- 48 30 49 - /// A decoder to decode `Uuid`s coming from a Postgres query. 50 - /// 51 31 fn uuid_decoder() { 52 32 use bit_array <- decode.then(decode.bit_array) 53 33 case uuid.from_bit_array(bit_array) {
-23
birdie_snapshots/query_that_needs_utils_and_enums_has_two_sections.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: query_that_needs_utils_and_enums_has_two_sections_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/time/calendar.{type Date} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(squirrel_colour: SquirrelColour, date: Date) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use squirrel_colour <- decode.field(0, squirrel_colour_decoder()) ··· 43 26 |> pog.execute(db) 44 27 } 45 28 46 - // --- Enums ------------------------------------------------------------------- 47 29 48 - /// Corresponds to the Postgres `squirrel_colour` enum. 49 - /// 50 - /// > 🐿️ This type definition was generated automatically using v-test of the 51 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 52 - /// 53 30 pub type SquirrelColour { 54 31 LightBrown 55 32 Grey
-17
birdie_snapshots/query_with_quoted_string_is_properly_escaped.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: query_with_quoted_string_is_properly_escaped_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(result: Int) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use result <- decode.field(0, decode.int)
-20
birdie_snapshots/recursive_common_table_query_with_semi_join.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: recursive_common_table_query_with_semi_join_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 import youid/uuid.{type Uuid} 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(id: Uuid, name: String) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db, arg_1) { 34 17 let decoder = { 35 18 use id <- decode.field(0, uuid_decoder()) ··· 59 42 |> pog.execute(db) 60 43 } 61 44 62 - // --- Encoding/decoding utils ------------------------------------------------- 63 45 64 - /// A decoder to decode `Uuid`s coming from a Postgres query. 65 - /// 66 46 fn uuid_decoder() { 67 47 use bit_array <- decode.then(decode.bit_array) 68 48 case uuid.from_bit_array(bit_array) {
-17
birdie_snapshots/right_join_columns_are_optional.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: right_join_columns_are_optional_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/option.{type Option} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(optional: Option(String), not_optional: String) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use optional <- decode.field(0, decode.optional(decode.string))
-11
birdie_snapshots/squirrel_supports_do_blocks.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: squirrel_supports_do_blocks_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// Runs the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This function was generated automatically using v-test of 20 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub fn query(db) { 23 12 let decoder = decode.map(decode.dynamic, fn(_) { Nil }) 24 13
-17
birdie_snapshots/string_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: string_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: String) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.string)
-17
birdie_snapshots/string_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: string_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/time_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: time_of_day_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/time/calendar.{type TimeOfDay} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(res: TimeOfDay) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use res <- decode.field(0, pog.calendar_time_of_day_decoder())
-17
birdie_snapshots/time_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: time_of_day_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/timestamp_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: timestamp_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import gleam/time/timestamp.{type Timestamp} 15 10 import pog 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(res: Timestamp) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use res <- decode.field(0, pog.timestamp_decoder())
-17
birdie_snapshots/timestamp_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: timestamp_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
-32
birdie_snapshots/using_uuids_more_than_once_results_in_a_single_uuid_decoder_helper.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: using_uuids_more_than_once_results_in_a_single_uuid_decoder_helper_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 import youid/uuid.{type Uuid} 16 11 17 - /// A row you get from running the `one` query 18 - /// defined in `one.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type OneRow { 24 13 OneRow(gen_random_uuid: Uuid) 25 14 } 26 15 27 - /// Runs the `one` query 28 - /// defined in `one.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn one(db) { 34 17 let decoder = { 35 18 use gen_random_uuid <- decode.field(0, uuid_decoder()) ··· 42 25 |> pog.execute(db) 43 26 } 44 27 45 - /// A row you get from running the `other` query 46 - /// defined in `other.sql`. 47 - /// 48 - /// > 🐿️ This type definition was generated automatically using v-test of the 49 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 50 - /// 51 28 pub type OtherRow { 52 29 OtherRow(gen_random_uuid: Uuid) 53 30 } 54 31 55 - /// Runs the `other` query 56 - /// defined in `other.sql`. 57 - /// 58 - /// > 🐿️ This function was generated automatically using v-test of 59 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 60 - /// 61 32 pub fn other(db) { 62 33 let decoder = { 63 34 use gen_random_uuid <- decode.field(0, uuid_decoder()) ··· 70 41 |> pog.execute(db) 71 42 } 72 43 73 - // --- Encoding/decoding utils ------------------------------------------------- 74 44 75 - /// A decoder to decode `Uuid`s coming from a Postgres query. 76 - /// 77 45 fn uuid_decoder() { 78 46 use bit_array <- decode.then(decode.bit_array) 79 47 case uuid.from_bit_array(bit_array) {
-20
birdie_snapshots/uuid_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: uuid_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 import youid/uuid.{type Uuid} 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(res: Uuid) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db) { 34 17 let decoder = { 35 18 use res <- decode.field(0, uuid_decoder()) ··· 42 25 |> pog.execute(db) 43 26 } 44 27 45 - // --- Encoding/decoding utils ------------------------------------------------- 46 28 47 - /// A decoder to decode `Uuid`s coming from a Postgres query. 48 - /// 49 29 fn uuid_decoder() { 50 30 use bit_array <- decode.then(decode.bit_array) 51 31 case uuid.from_bit_array(bit_array) {
-17
birdie_snapshots/uuid_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: uuid_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 import youid/uuid 16 11 17 - /// A row you get from running the `query` query 18 - /// defined in `query.sql`. 19 - /// 20 - /// > 🐿️ This type definition was generated automatically using v-test of the 21 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 22 - /// 23 12 pub type QueryRow { 24 13 QueryRow(res: Bool) 25 14 } 26 15 27 - /// Runs the `query` query 28 - /// defined in `query.sql`. 29 - /// 30 - /// > 🐿️ This function was generated automatically using v-test of 31 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 32 - /// 33 16 pub fn query(db, arg_1) { 34 17 let decoder = { 35 18 use res <- decode.field(0, decode.bool)
-17
birdie_snapshots/varchar_decoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: varchar_decoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: String) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.string)
-17
birdie_snapshots/varchar_encoding.accepted
··· 4 4 file: ./test/squirrel_test.gleam 5 5 test_name: varchar_encoding_test 6 6 --- 7 - //// This module contains the code to run the sql queries defined in 8 - //// `./test-directory`. 9 - //// > 🐿️ This module was generated automatically using v-test of 10 - //// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 11 - //// 12 7 13 8 import gleam/dynamic/decode 14 9 import pog 15 10 16 - /// A row you get from running the `query` query 17 - /// defined in `query.sql`. 18 - /// 19 - /// > 🐿️ This type definition was generated automatically using v-test of the 20 - /// > [squirrel package](https://github.com/giacomocavalieri/squirrel). 21 - /// 22 11 pub type QueryRow { 23 12 QueryRow(res: Bool) 24 13 } 25 14 26 - /// Runs the `query` query 27 - /// defined in `query.sql`. 28 - /// 29 - /// > 🐿️ This function was generated automatically using v-test of 30 - /// > the [squirrel package](https://github.com/giacomocavalieri/squirrel). 31 - /// 32 15 pub fn query(db, arg_1) { 33 16 let decoder = { 34 17 use res <- decode.field(0, decode.bool)
+48 -11
test/squirrel_test.gleam
··· 201 201 should_codegen_queries([#("query", query)]) 202 202 } 203 203 204 + fn should_codegen_with_comments(query: String) { 205 + should_codegen_queries_options( 206 + [#("query", query)], 207 + CodegenOptions(strip_comments: False), 208 + ) 209 + } 210 + 204 211 fn should_codegen_queries(queries: List(#(String, String))) -> String { 212 + should_codegen_queries_options(queries, CodegenOptions(strip_comments: True)) 213 + } 214 + 215 + fn should_codegen_queries_with_comments( 216 + queries: List(#(String, String)), 217 + ) -> String { 218 + should_codegen_queries_options(queries, CodegenOptions(strip_comments: False)) 219 + } 220 + 221 + fn should_codegen_queries_options( 222 + queries: List(#(String, String)), 223 + options: CodegenOptions, 224 + ) { 205 225 // We assert everything went smoothly and we have no errors in the query. 206 226 let assert Ok(#(queries, [])) = type_queries(queries) 207 - query.generate_code("v-test", for: queries, from: "./test-directory") 227 + let code = 228 + query.generate_code("v-test", for: queries, from: "./test-directory") 229 + 230 + let CodegenOptions(strip_comments:) = options 231 + case strip_comments { 232 + False -> code 233 + True -> 234 + string.split(code, on: "\n") 235 + |> list.filter(keeping: fn(line) { !string.starts_with(line, "//") }) 236 + |> string.join(with: "\n") 237 + } 238 + } 239 + 240 + type CodegenOptions { 241 + CodegenOptions( 242 + /// Removes all lines starting with `//` from the generated code. 243 + strip_comments: Bool, 244 + ) 208 245 } 209 246 210 247 fn type_queries( ··· 515 552 -- This is a comment 516 553 select true as res 517 554 " 518 - |> should_codegen 555 + |> should_codegen_with_comments 519 556 |> birdie.snap(title: "query with comment") 520 557 } 521 558 ··· 525 562 -- that goes over multiple lines! 526 563 select true as res 527 564 " 528 - |> should_codegen 565 + |> should_codegen_with_comments 529 566 |> birdie.snap(title: "query with multiline comment") 530 567 } 531 568 ··· 727 764 // 728 765 729 766 pub fn checking_two_identical_snippets_of_code_test() { 730 - let code = should_codegen("select 1 as number") 767 + let code = should_codegen_with_comments("select 1 as number") 731 768 let assert squirrel.Same = squirrel.compare_code_snippets(code, code) 732 769 } 733 770 734 771 pub fn if_code_snippets_differ_by_formatting_they_are_the_same_test() { 735 - let expected_code = should_codegen("select 1 as number") 772 + let expected_code = should_codegen_with_comments("select 1 as number") 736 773 let actual_code = expected_code |> string.replace(each: "\n", with: "\n ") 737 774 let assert squirrel.Same = 738 775 squirrel.compare_code_snippets(expected_code, actual_code) 739 776 } 740 777 741 778 pub fn if_code_snippets_differ_by_comments_they_are_the_same_test() { 742 - let expected_code = should_codegen("select 1 as number") 779 + let expected_code = should_codegen_with_comments("select 1 as number") 743 780 let actual_code = "// Comment!\n" <> expected_code 744 781 let assert squirrel.Same = 745 782 squirrel.compare_code_snippets(expected_code, actual_code) 746 783 } 747 784 748 785 pub fn comparing_different_snippets_of_code_test() { 749 - let expected_code = should_codegen("select 1 as number") 750 - let actual_code = should_codegen("select 2 as number") 786 + let expected_code = should_codegen_with_comments("select 1 as number") 787 + let actual_code = should_codegen_with_comments("select 2 as number") 751 788 let assert squirrel.Different = 752 789 squirrel.compare_code_snippets(expected_code, actual_code) 753 790 } ··· 788 825 789 826 // https://github.com/giacomocavalieri/squirrel/issues/29 790 827 pub fn there_is_only_one_empty_line_between_code_generated_for_different_queries_test() { 791 - should_codegen_queries([ 828 + should_codegen_queries_with_comments([ 792 829 #("one", "select 1 as res"), 793 830 #("two", "select 2 as res"), 794 831 ]) ··· 884 921 pub fn file_with_squirrel_module_comment_is_considered_as_generated_test() { 885 922 assert squirrel.LikelyGenerated 886 923 == "select 1 as wibble" 887 - |> should_codegen 924 + |> should_codegen_with_comments 888 925 |> squirrel.classify_file_content 889 926 } 890 927 891 928 pub fn file_with_squirrel_function_comment_is_considered_as_generated_test() { 892 929 assert squirrel.LikelyGenerated 893 930 == "select 1 as wibble" 894 - |> should_codegen 931 + |> should_codegen_with_comments 895 932 // We remove the starting module comment, since we want to make sure 896 933 // squirrel can pick up a generated file even if that bit is missing! 897 934 |> string.split(on: "\n")