Something went wrong. Try again.
🐿️ Type safe SQL in Gleam
Something went wrong. Try again.
488 B · 28 lines
at bits-support
1234567891011121314151617181920212223242526272829---version: 1.4.0title: float4 decodingfile: ./test/squirrel_test.gleamtest_name: float4_decoding_test---import gleam/dynamic/decodeimport pogpub type QueryRow { QueryRow(res: Float)}pub fn query( db: pog.Connection,) -> Result(pog.Returned(QueryRow), pog.QueryError) { let decoder = { use res <- decode.field(0, decode.float) decode.success(QueryRow(res:)) } "select 1.1::float4 as res" |> pog.query |> pog.returning(decoder) |> pog.execute(db)}