Skip to content

Commit

Permalink
Add simple hello message
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke committed Aug 2, 2024
1 parent 3464369 commit d0de610
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/core/pg.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ init:
switch q := msg.(type) {
case *pgproto3.Query:
ylogger.Zero.Info().Str("query", q.String).Msg("serving request")

conn.Send(&pgproto3.RowDescription{
Fields: []pgproto3.FieldDescription{
{
Name: []byte("row"),
DataTypeOID: 25, /* textoid*/
},
},
})

conn.Send(&pgproto3.DataRow{
Values: [][]byte{[]byte("hi")},
})
conn.Send(&pgproto3.CommandComplete{CommandTag: []byte("YPROXYHELLO")})

conn.Send(&pgproto3.ReadyForQuery{})
conn.Flush()
default:
Expand Down

0 comments on commit d0de610

Please sign in to comment.