| Copyright | (c) digitally induced GmbH 2025 |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
IHP.Hasql.FromRow
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 HasqlDecodeValue a where
- hasqlDecodeValue :: Value 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
class HasqlDecodeValue a where Source #
Typeclass mapping Haskell scalar types to hasql value decoders
Methods
hasqlDecodeValue :: Value a Source #
Instances
class HasqlDecodeColumn a where Source #
Typeclass for building column-level row decoders, handling nullable/non-nullable
Methods
hasqlColumnDecoder :: Row a Source #
Instances
| HasqlDecodeValue a => HasqlDecodeColumn a Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlColumnDecoder :: Row a Source # | |
| HasqlDecodeValue a => HasqlDecodeColumn (Maybe a) Source # | |
Defined in IHP.Hasql.FromRow Methods hasqlColumnDecoder :: Row (Maybe a) Source # | |