def query

bend-kit-postgres@0.3.0.0 · postgres.bend:570

import bend-kit-postgres@0.3.0.0/postgres.bend as Postgres
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-postgres@0.3.0.0/codec.bend as Codec

570# Runs sql (a byte string, parameters as $1, $2, ...) as an unnamed prepared statement:
571# Parse, Bind, Describe, Execute, Sync. Parameters and results are in text format; None is NULL.
572# A server error is a Failed reply on a live connection; a Failure has closed it.
573def query(c: Conn, +sql: String, params: List<&1, Maybe<&1, Bytes.Bytes>>) -> IO(Result<&1, &1, Failure, Conn & Reply>):
574  do IO<Result<&1, &1, Failure, Conn & Reply>>:
575    s : Result<&1, &1, Failure, Conn> <- send(c, query.bytes(sql, params))
576    m : Result<&1, &1, Failure, Conn & Codec.Back> <- reply(s)
577    collect(Nat.mul(65536n, 65536n), absorbed(Acc{Nil{}, Nil{}, Bytes.new(0), None{}}, m))

Uses (20)

Used by (0)

No other definition uses this definition.