data PGresult : Type Internal phantom type used to mark pointers to the
`libpq` struct of the same name.
Totality: total
Visibility: exportdata Result : Type The result of executing a command. See `Postgres.Exec`
for more.
Totality: total
Visibility: export
Constructor: MkResult : Ptr PGresult -> Result
interface ResultProducer : Type -> Type -> Type All of the various forms of execution supported by libpq
provide types that conform to the `ResultProducer` interface.
Parameters: source, input
Methods:
exec : source -> input -> IO (Ptr PGresult)
Implementation: ResultProducer ExecSource String
exec : ResultProducer source input => source -> input -> IO (Ptr PGresult)- Visibility: public export
withResult : ResultProducer source a => source -> a -> (Result -> IO b) -> IO b Execute the given result producer, do the given thing with the
result, and then free the memory used for the result.
Visibility: exportpgResultStatus : Result -> ResultStatus- Visibility: export
pgResultSuccess : Result -> Bool- Visibility: export
pgResultErrorMessage : Result -> Maybe String Get the Postgres error message for the given result or
Nothing if the result was a success.
Visibility: exportdata TupleResult : Nat -> Nat -> Type- Totality: total
Visibility: export
Constructor: MkTupleResult : (res : Result) -> TupleResult (resultRowCount res) (resultColCount res)
tupleResult : (res : Result) -> Maybe (TupleResult (resultRowCount res) (resultColCount res))- Visibility: export
pgResultSize : TupleResult r c -> (Nat, Nat) Get the size of the resultset as (row, col).
Visibility: exportpgResultStringValue : TupleResult rows cols -> Fin rows -> Fin cols -> String Get the result value at the given row and column as a String regardless
of what the underlying Postgres type is.
Null postgres values are treated as empty strings.
Use `pgResultNullableStringValue` to handle nulls as Nothing.
Visibility: exportpgResultNullableStringValue : TupleResult rows cols -> Fin rows -> Fin cols -> Maybe String Get the result value at the given row and column as a (Maybe String) regardless
of what the underlying Postgres type is.
Null postgres values are Nothing, whereas all other values are String (this does not
fail to parse Strings by returning Nothing -- anything non-null is guaranteed to return
a `Just` value).
Use `pgResultStringValue` to handle nulls as empty Strings.
Visibility: export The combination of name and type information for a single Postgres result column.
Totality: total
Visibility: public export
Constructor:
Projections:
Hint: Show ColHeader
- Visibility: public export
- Visibility: public export
- Visibility: public export
- Visibility: public export
pgStringResultset : TupleResult rows cols -> Vect rows (Vect cols (Lazy String)) Get the resultset (all rows and columns) with all values as Strings
regardless of the underlying Postgres value type.
Null is treated as the empty String.
To get (Maybe String) where null is Nothing, use `pgNullableStringResultset`
Visibility: exportStringResultset : Bool -> Type- Visibility: public export
pgNullableStringResultset : TupleResult rows cols -> Vect rows (Vect cols (Lazy (Maybe String))) Get the resultset (all rows and columns) with all values as (Maybe Strings)
regardless of the underlying Postgres value type.
Null is treated as Nothing -- No matter what type the Postgres column is, a non-null
value will be a `Just` value with a String in it; Nothing only means null, not
ever that the value failed to parse as a String.
To get String where null is the empty String, use `pgStringResultset`
Visibility: exportpgResultsetColNames : TupleResult rows cols -> Vect cols String- Visibility: export
pgResultsetColTypes : TypeDictionary => TupleResult rows cols -> Vect cols PType Get all the column types for the given result. Note that
this is currently limited by the few known types that
are looked up and stored in the TypeDictionary.
Visibility: export