jaredzhou/moonpg/wire does not have a README file
pub(all) suberror WireError {
PgServer(String)
Connect(String)
Auth(String)
Parse(String)
InvalidMessage(String)
IO(String)
}pub(all) struct AuthenticationCleartextPassword {
}impl Message for AuthenticationCleartextPasswordpub(all) struct AuthenticationMD5Password {
salt : Bytes
}impl Message for AuthenticationMD5Passwordpub(all) struct AuthenticationOk {
}impl Message for AuthenticationOkpub(all) struct AuthenticationSASLContinue {
data : Bytes
}impl Message for AuthenticationSASLContinuepub(all) struct AuthenticationSASLFinal {
data : Bytes
}impl Message for AuthenticationSASLFinalpub(all) struct BackendKeyData {
pid : Int
secret_key : Int
}impl Message for BackendKeyDatapub(all) enum BackendMessage {
AuthenticationOk(AuthenticationOk)
AuthenticationCleartextPassword(AuthenticationCleartextPassword)
AuthenticationMD5Password(AuthenticationMD5Password)
AuthenticationSASL(AuthenticationSASL)
AuthenticationSASLContinue(AuthenticationSASLContinue)
AuthenticationSASLFinal(AuthenticationSASLFinal)
BackendKeyData(BackendKeyData)
ReadyForQuery(ReadyForQuery)
ParameterStatus(ParameterStatus)
ErrorResponse(ErrorResponse)
NoticeResponse(NoticeResponse)
RowDescription(RowDescription)
DataRow(DataRow)
CommandComplete(CommandComplete)
EmptyQueryResponse(EmptyQueryResponse)
ParseComplete(ParseComplete)
BindComplete(BindComplete)
CloseComplete(CloseComplete)
ParameterDescription(ParameterDescription)
NoData(NoData)
PortalSuspended(PortalSuspended)
CopyInResponse(CopyInResponse)
CopyOutResponse(CopyOutResponse)
CopyBothResponse(CopyBothResponse)
CopyData(CopyData)
CopyDone(CopyDone)
NotificationResponse(NotificationResponse)
NegotiateProtocolVersion(NegotiateProtocolVersion)
Unknown(Byte, BytesView)
}pub(all) struct BindComplete {
}impl Message for BindCompletepub(all) struct BytesMut {
// private fields
}pub(all) struct Close {
variant : Byte
name : String
}pub(all) struct CloseComplete {
}impl Message for CloseCompleteimpl Message for CommandCompletepub struct CommandTag {
tag : String
}impl Show for CommandTagpub(all) struct Config {
host : String
hostaddr : String?
port : Int
user : String
database : String?
password : String?
sslmode : String
sslrootcert : String?
sslcert : String?
sslkey : String?
application_name : String?
connect_timeout : Int
statement_timeout : Int
target_session_attrs : String
trace : Bool
}postgresql://[user[:password]@][host][:port][/dbname][?param=value&...]host=localhost port=5432 user=alice dbname=mydb password=secretfn Config::new(user : String, host? : String, hostaddr? : String?, port? : Int, database? : String?, password? : String?, sslmode? : String, sslrootcert? : String?, sslcert? : String?, sslkey? : String?, application_name? : String?, connect_timeout? : Int, statement_timeout? : Int, target_session_attrs? : String, trace? : Bool) -> Configpub(all) struct ConnParam {
key : String
value : String
}impl Message for CopyBothResponsepub(all) struct CopyData {
data : Bytes
}pub(all) struct CopyDone {
}pub(all) struct CopyFail {
message : String
}impl Message for CopyInResponseimpl Message for CopyOutResponsepub(all) struct Describe {
variant : Byte
name : String
}pub(all) struct EmptyQueryResponse {
}impl Message for EmptyQueryResponsepub(all) struct Execute {
portal : String
max_rows : Int
}pub(all) struct FieldDescription {
name : String
table_oid : Int
attr_num : Int
type_oid : Int
typlen : Int
typmod : Int
format : Int
}pub(all) struct Flush {
}impl Message for NegotiateProtocolVersionpub(all) struct NoData {
}pub(all) struct NotificationResponse {
pid : Int
channel : String
payload : String
}impl Message for NotificationResponseimpl Message for ParameterDescriptionpub(all) struct ParameterStatus {
name : String
value : String
}impl Message for ParameterStatuspub(all) struct ParseComplete {
}impl Message for ParseCompletepub(all) struct PasswordMessage {
password : String
}impl Message for PasswordMessagepub(all) struct PortalSuspended {
}impl Message for PortalSuspendedpub(all) struct Query {
sql : String
}pub struct RawConn {
stream : Stream
trace : Bool
host : String
port : Int
params : HashMap[String, String]
pid : Int
secret_key : Int
tx_status : TransactionStatus
status : ConnStatus
}async fn RawConn::describe_portal(self : RawConn, portal : String) -> Array[FieldDescription] raise WireErrorasync fn RawConn::execute(self : RawConn, portal : String, columns : Array[FieldDescription], max_rows : Int) -> ResultReader raise WireErrorasync fn RawConn::execute_statement(self : RawConn, stmt_desc : StatementDescription, param_values : Array[Bytes?], param_formats : Array[Int], result_formats? : Array[Int]) -> ResultReader raise WireErrorasync fn RawConn::prepare(self : RawConn, name : String, sql : String, param_types : Array[Int]) -> StatementDescription raise WireErrorpub struct ResultReader {
conn : RawConn
columns : Array[FieldDescription]
row_values : Array[Bytes?]?
closed : Bool
tag : CommandTag?
}while r.has_next() { let row = r.data_row(); ... }
let tag = r.close()let result = r.read()pub(all) struct SASLInitialResponse {
mechanism : String
initial_response : Bytes
}impl Message for SASLInitialResponsepub(all) struct SASLResponse {
data : Bytes
}impl Message for SASLResponsepub(all) struct StatementDescription {
name : String
sql : String
param_oids : Array[Int]
fields : Array[FieldDescription]
}pub(all) struct Sync {
}pub(all) struct Terminate {
}impl Show for TransactionStatuslet MSG_NEGOTIATE_PROTOCOL_VERSION : Bytefn compute_md5_password(password : String, user : String, salt : Bytes) -> StringA pure MoonBit PostgreSQL client, wire protocol from scratch.
Dependencies