| Copyright | (c) digitally induced GmbH 2025 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
IHP.Hasql.FromRow
Contents
Description
This module provides FromRowHasql, a typeclass parallel to postgresql-simple's FromRow,
for decoding database rows using hasql's more efficient prepared statement approach.
Instances are generated by the SchemaCompiler with explicit inline decoders in idiomatic hasql applicative style.
Also provides parser functions used by the generated decoders for custom PostgreSQL types.
Synopsis
- class FromRowHasql a where
- hasqlRowDecoder :: Row a
- class HasqlDecodeColumn a where
- hasqlColumnDecoder :: Row a
Documentation
class FromRowHasql a where Source #
Typeclass for types that can be decoded from a hasql result row
This is the hasql equivalent of postgresql-simple's FromRow class.
The SchemaCompiler generates instances for all model types using idiomatic
hasql applicative style with explicit inline decoders.
Instances
| HasqlDecodeColumn a => FromRowHasql (Only a) Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlRowDecoder :: Row (Only a) Source # | |
| (HasqlDecodeColumn a, HasqlDecodeColumn b) => FromRowHasql (a, b) Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlRowDecoder :: Row (a, b) Source # | |
| (HasqlDecodeColumn a, HasqlDecodeColumn b, HasqlDecodeColumn c) => FromRowHasql (a, b, c) Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlRowDecoder :: Row (a, b, c) Source # | |
| (HasqlDecodeColumn a, HasqlDecodeColumn b, HasqlDecodeColumn c, HasqlDecodeColumn d) => FromRowHasql (a, b, c, d) Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlRowDecoder :: Row (a, b, c, d) Source # | |
| (HasqlDecodeColumn a, HasqlDecodeColumn b, HasqlDecodeColumn c, HasqlDecodeColumn d, HasqlDecodeColumn e) => FromRowHasql (a, b, c, d, e) Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlRowDecoder :: Row (a, b, c, d, e) Source # | |
class HasqlDecodeColumn a where Source #
Typeclass for building column-level row decoders, handling nullable/non-nullable.
Uses IsScalar from hasql-mapping for value-level decoding.
Methods
hasqlColumnDecoder :: Row a Source #
Instances
| HasqlDecodeColumn Int Source # | IHP's schema maps SQL |
Defined in IHP.Hasql.FromRow Methods | |
| IsScalar a => HasqlDecodeColumn a Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlColumnDecoder :: Row a Source # | |
| IsScalar (PrimaryKey table) => HasqlDecodeColumn (Id' table) Source # | Decode |
Defined in IHP.Hasql.FromRow Methods hasqlColumnDecoder :: Row (Id' table) Source # | |
| IsScalar (PrimaryKey table) => HasqlDecodeColumn (Maybe (Id' table)) Source # | Decode 'Maybe (Id' table)' for nullable foreign keys |
Defined in IHP.Hasql.FromRow | |
| HasqlDecodeColumn (Maybe Int) Source # | |
Defined in IHP.Hasql.FromRow | |
| IsScalar a => HasqlDecodeColumn (Maybe a) Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlColumnDecoder :: Row (Maybe a) Source # | |
Orphan instances
| IsScalar Integer Source # | IHP's schema maps SQL |
| IsScalar (PrimaryKey table) => IsScalar (Id' table) Source # |
|