mirror of https://github.com/jackc/pgx.git
Extract txStartupMessage
parent
24e11001c5
commit
efa94833e4
7
conn.go
7
conn.go
|
@ -34,7 +34,7 @@ func Connect(options map[string]string) (c *conn, err error) {
|
|||
|
||||
msg := newStartupMessage()
|
||||
msg.options["user"] = "jack"
|
||||
c.conn.Write(msg.Bytes())
|
||||
c.txStartupMessage(msg)
|
||||
|
||||
var response interface{}
|
||||
response, err = c.rxMsg()
|
||||
|
@ -143,3 +143,8 @@ func (c *conn) rxReadyForQuery(buf []byte) (msg *readyForQuery) {
|
|||
msg.txStatus = buf[0]
|
||||
return
|
||||
}
|
||||
|
||||
func (c *conn) txStartupMessage(msg *startupMessage) (err error) {
|
||||
_, err = c.conn.Write(msg.Bytes())
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue