def query.bytes

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

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

561# The whole extended-query exchange for one statement, in one write.
562def query.bytes(+sql: String, params: List<&1, Maybe<&1, Bytes.Bytes>>) -> Bytes.Bytes:
563  Bytes.concat([
564    Codec.encode(Codec.Parse{Bytes.new(0), bytes(sql), Nil{}}),
565    Codec.encode(Codec.Bind{Bytes.new(0), Bytes.new(0), Nil{}, params, Nil{}}),
566    Codec.encode(Codec.Describe{80, Bytes.new(0)}),
567    Codec.encode(Codec.Execute{Bytes.new(0), 0}),
568    Codec.encode(Codec.Sync{})])

Uses (9)

Used by (1)