···11+---
22+version: 1.3.0
33+title: query with quoted string is properly escaped
44+file: ./test/squirrel_test.gleam
55+test_name: query_with_quoted_string_is_properly_escaped_test
66+---
77+import gleam/dynamic/decode
88+import pog
99+1010+/// A row you get from running the `query` query
1111+/// defined in `query.sql`.
1212+///
1313+/// > 🐿️ This type definition was generated automatically using v-test of the
1414+/// > [squirrel package](https://github.com/giacomocavalieri/squirrel).
1515+///
1616+pub type QueryRow {
1717+ QueryRow(result: Int)
1818+}
1919+2020+/// Runs the `query` query
2121+/// defined in `query.sql`.
2222+///
2323+/// > 🐿️ This function was generated automatically using v-test of
2424+/// > the [squirrel package](https://github.com/giacomocavalieri/squirrel).
2525+///
2626+pub fn query(db) {
2727+ let decoder = {
2828+ use result <- decode.field(0, decode.int)
2929+ decode.success(QueryRow(result:))
3030+ }
3131+3232+ "select 1 as \"result\""
3333+ |> pog.query
3434+ |> pog.returning(decoder)
3535+ |> pog.execute(db)
3636+}
+6
test/squirrel_test.gleam
···551551 |> birdie.snap(title: "query that needs utils and enums has two sections")
552552}
553553554554+pub fn query_with_quoted_string_is_properly_escaped_test() {
555555+ "select 1 as \"result\""
556556+ |> should_codegen
557557+ |> birdie.snap(title: "query with quoted string is properly escaped")
558558+}
559559+554560// --- ERRROR TESTS ------------------------------------------------------------
555561// This is a group of tests to ensure that the errors look good when something
556562// goes wrong.