Build fully operational Frontend
This commit is contained in:
@@ -482,8 +482,8 @@ func makeDefaultDialer() *net.Dialer {
|
||||
}
|
||||
|
||||
func makeDefaultBuildFrontendFunc() BuildFrontendFunc {
|
||||
return func(r io.Reader) Frontend {
|
||||
frontend, _ := pgproto3.NewFrontend(pgproto3.NewChunkReader(r), nil)
|
||||
return func(r io.Reader, w io.Writer) Frontend {
|
||||
frontend, _ := pgproto3.NewFrontend(pgproto3.NewChunkReader(r), w)
|
||||
|
||||
return frontend
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ type Notification struct {
|
||||
type DialFunc func(ctx context.Context, network, addr string) (net.Conn, error)
|
||||
|
||||
// BuildFrontendFunc is a function that can be used to create Frontend implementation for connection.
|
||||
type BuildFrontendFunc func(r io.Reader) Frontend
|
||||
type BuildFrontendFunc func(r io.Reader, w io.Writer) Frontend
|
||||
|
||||
// NoticeHandler is a function that can handle notices received from the PostgreSQL server. Notices can be received at
|
||||
// any time, usually during handling of a query response. The *PgConn is provided so the handler is aware of the origin
|
||||
@@ -174,7 +174,7 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig
|
||||
func() { pgConn.conn.SetDeadline(time.Time{}) },
|
||||
)
|
||||
|
||||
pgConn.frontend = config.BuildFrontend(pgConn.conn)
|
||||
pgConn.frontend = config.BuildFrontend(pgConn.conn, pgConn.conn)
|
||||
|
||||
startupMsg := pgproto3.StartupMessage{
|
||||
ProtocolVersion: pgproto3.ProtocolVersionNumber,
|
||||
|
||||
Reference in New Issue
Block a user