unmbt/ciallo-driver-pg/proto does not have a README file

    AuthRequest

    pub(all) enum AuthRequest {
    Ok
    CleartextPassword
    Md5Password(Bytes)
    Sasl(Array[String])
    SaslContinue(Bytes)
    SaslFinal(Bytes)
    Unsupported(Int)
    } derive(Eq,
    Debug
    )

    BackendMessage

    pub(all) enum BackendMessage {
    Authentication(AuthRequest)
    BackendKeyData(process_id~ : Int, secret_key~ : Int)
    ParameterStatus(name~ : String, value~ : String)
    ReadyForQuery(status~ : Byte)
    ParseComplete
    BindComplete
    CloseComplete
    EmptyQueryResponse
    NoData
    ParameterDescription(Array[Int])
    RowDescription(Array[FieldDesc])
    DataRow(Array[Bytes?])
    CommandComplete(String)
    ErrorResponse(PgErrorFields)
    NoticeResponse(PgErrorFields)
    PortalSuspended
    Unknown(tag~ : Byte, payload~ : Bytes)
    } derive(Eq,
    Debug
    )

    FieldDesc

    pub(all) struct FieldDesc {
    name : String
    table_oid : Int
    column_attr : Int
    type_oid : Int
    type_size : Int
    type_modifier : Int
    format_code : Int
    } derive(Eq,
    Debug
    )

    PgDecoder

    pub struct PgDecoder {
    // private fields
    }

    Stateful streaming PG backend message decoder using a cursor buffer to avoid O(N^2) copies.

    PgDecoder::PgDecoder

    fn PgDecoder::PgDecoder() -> PgDecoder

    PgDecoder::feed

    fn PgDecoder::feed(self : PgDecoder, chunk : BytesView) -> Unit

    PgDecoder::next_message

    PgErrorFields

    pub(all) struct PgErrorFields {
    severity : String
    code : String
    message : String
    detail : String?
    constraint : String?
    table : String?
    } derive(Eq,
    Debug
    )

    ScramClient

    pub struct ScramClient {
    // private fields
    }

    Client-side SCRAM-SHA-256 authentication state machine.

    ScramClient::ScramClient

    fn ScramClient::ScramClient(user~ : String, password~ : String, client_nonce~ : String) -> ScramClient

    Creates a SCRAM-SHA-256 state machine with caller-supplied nonce (allowing deterministic unit tests and CSPRNG nonces in production connections).

    ScramClient::client_first_message

    fn ScramClient::client_first_message(self : ScramClient) -> Bytes

    Produces the client-first-message (n,,n=<user>,r=<nonce>).

    ScramClient::process_server_first

    fn ScramClient::process_server_first(self : ScramClient, server_first_bytes : BytesView) -> Bytes raise
    DataError

    Processes server-first-message (r=<nonce>,s=<salt-b64>,i=<iterations>) and produces client-final-message (c=biws,r=<nonce>,p=<proof-b64>).

    ScramClient::verify_server_final

    fn ScramClient::verify_server_final(self : ScramClient, server_final_bytes : BytesView) -> Unit raise
    DataError

    Verifies server-final-message (v=<server-signature-b64>) in constant time.

    decode_backend_message

    fn decode_backend_message(buf : BytesView) -> (BackendMessage, Int)? raise
    DataError

    Decodes one complete PostgreSQL backend message from buf, returning (message, bytes_consumed). Returns None if more bytes are needed.

    decode_sql_cell

    Decodes a PostgreSQL text-format column cell using its FieldDesc OID.

    decode_sql_row

    Decodes a DataRow using a prior RowDescription into a @orm_schema.SqlRow.

    decode_sql_row_indexed

    Decodes a DataRow sharing a prebuilt result-set @orm_schema.ColumnIndex (O(1) column lookup, zero column-name array duplication).

    encode_bind

    fn encode_bind(portal_name~ : String, stmt_name~ : String, params~ : Array[Bytes?]) -> Bytes

    Encodes an Extended Query Bind ('B') message using text parameter & result format codes.

    encode_cancel_request

    fn encode_cancel_request(process_id~ : Int, secret_key~ : Int) -> Bytes

    Encodes a PostgreSQL CancelRequest packet (16 bytes, code 80877102).

    encode_close

    fn encode_close(target~ : Byte, name~ : String) -> Bytes

    Encodes an Extended Query Close ('C') message (target: b'S' or b'P').

    encode_describe

    fn encode_describe(target~ : Byte, name~ : String) -> Bytes

    Encodes an Extended Query Describe ('D') message (target: b'S' for Statement or b'P' for Portal).

    encode_execute

    fn encode_execute(portal_name~ : String, max_rows? : Int) -> Bytes

    Encodes an Extended Query Execute ('E') message (max_rows = 0 means unlimited).

    encode_parse

    fn encode_parse(stmt_name~ : String, sql~ : String, param_oids? : Array[Int]) -> Bytes

    Encodes an Extended Query Parse ('P') message.

    encode_password_message

    fn encode_password_message(password : StringView) -> Bytes

    Encodes a PasswordMessage ('p') for cleartext or MD5 authentication.

    encode_sasl_initial_response

    fn encode_sasl_initial_response(mechanism : StringView, initial_data : BytesView) -> Bytes

    Encodes a SASLInitialResponse ('p') message for SCRAM-SHA-256.

    encode_sasl_response

    fn encode_sasl_response(data : BytesView) -> Bytes

    Encodes a SASLResponse ('p') message carrying client-final-message.

    encode_simple_query

    fn encode_simple_query(sql : StringView) -> Bytes

    Encodes a Simple Query ('Q') message.

    encode_sql_param

    fn encode_sql_param(val :
    SqlValue
    ) -> Bytes?

    Encodes a SqlValue into PostgreSQL text-format wire parameter bytes (None for SQL NULL).

    encode_ssl_request

    fn encode_ssl_request() -> Bytes

    Encodes a PostgreSQL SSLRequest negotiation packet (8 bytes).

    encode_startup

    fn encode_startup(user~ : String, database~ : String, params? : Array[(String, String)]) -> Bytes

    Encodes a PostgreSQL v3 StartupMessage (no leading type byte).

    encode_sync

    fn encode_sync() -> Bytes

    Encodes a Sync ('S') message.

    encode_terminate

    fn encode_terminate() -> Bytes

    Encodes a Terminate ('X') message.

    map_pg_error

    Maps PostgreSQL ErrorResponse SQLSTATE codes into structured @codec.DataError variants.

    oid_bool

    let oid_bool : Int

    oid_bytea

    let oid_bytea : Int

    oid_float4

    let oid_float4 : Int

    oid_float8

    let oid_float8 : Int

    oid_int2

    let oid_int2 : Int

    oid_int4

    let oid_int4 : Int

    oid_int8

    let oid_int8 : Int

    oid_json

    let oid_json : Int

    oid_jsonb

    let oid_jsonb : Int

    oid_numeric

    let oid_numeric : Int

    oid_text

    let oid_text : Int

    oid_uuid

    let oid_uuid : Int

    oid_varchar

    let oid_varchar : Int

    parse_command_complete_rows

    fn parse_command_complete_rows(tag : StringView) -> Int64

    Extracts the rows-affected count from a PostgreSQL CommandComplete tag (e.g., "INSERT 0 1", "UPDATE 5", "DELETE 3", "SELECT 10").

    pg_cancel_request_code

    let pg_cancel_request_code : Int

    pg_protocol_version

    let pg_protocol_version : Int

    pg_ssl_request_code

    let pg_ssl_request_code : Int