diff --git a/internal/client/client.go b/internal/client/client.go index 195f40e..1fe1921 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -325,6 +325,7 @@ func (p *Client) Execute( conn.capabilities1pX(), copyState(p.state), nil, + true, ) if err != nil { return err diff --git a/internal/client/granularflow2pX.go b/internal/client/granularflow2pX.go index 4fb0293..f40a6ed 100644 --- a/internal/client/granularflow2pX.go +++ b/internal/client/granularflow2pX.go @@ -30,16 +30,22 @@ func (c *protocolConnection) execGranularFlow2pX( r *buff.Reader, q *query, ) error { - ids, ok := c.getCachedTypeIDs(q) - if !ok { - return c.pesimistic2pX(r, q) - } + var cdcs *codecPair + if q.parse { + ids, ok := c.getCachedTypeIDs(q) + if !ok { + return c.pesimistic2pX(r, q) + } - cdcs, err := c.codecsFromIDsV2(ids, q) - if err != nil { - return err - } else if cdcs == nil { - return c.pesimistic2pX(r, q) + var err error + cdcs, err = c.codecsFromIDsV2(ids, q) + if err != nil { + return err + } else if cdcs == nil { + return c.pesimistic2pX(r, q) + } + } else { + cdcs = &codecPair{in: codecs.NoOpEncoder, out: codecs.NoOpDecoder} } return c.execute2pX(r, q, cdcs) diff --git a/internal/client/introspect.go b/internal/client/introspect.go index 4a7b3f7..feb922e 100644 --- a/internal/client/introspect.go +++ b/internal/client/introspect.go @@ -94,6 +94,7 @@ func DescribeV2( fmt: Binary, expCard: Many, capabilities: userCapabilities, + parse: true, } r, err := conn.conn.acquireReader(ctx) diff --git a/internal/client/query.go b/internal/client/query.go index d3bb7c4..033ee76 100644 --- a/internal/client/query.go +++ b/internal/client/query.go @@ -38,6 +38,7 @@ type query struct { args []interface{} capabilities uint64 state map[string]interface{} + parse bool } func (q *query) flat() bool { @@ -66,6 +67,7 @@ func newQuery( capabilities uint64, state map[string]interface{}, out interface{}, + parse bool, ) (*query, error) { var ( expCard Cardinality @@ -82,6 +84,7 @@ func newQuery( args: args, capabilities: capabilities, state: state, + parse: parse, }, nil case "Query": expCard = Many @@ -107,6 +110,7 @@ func newQuery( args: args, capabilities: capabilities, state: state, + parse: parse, } var err error @@ -159,7 +163,15 @@ func runQuery( } } - q, err := newQuery(method, cmd, args, c.capabilities1pX(), state, out) + q, err := newQuery( + method, + cmd, + args, + c.capabilities1pX(), + state, + out, + true, + ) if err != nil { return err } diff --git a/internal/client/transaction.go b/internal/client/transaction.go index 30dc6e6..f013291 100644 --- a/internal/client/transaction.go +++ b/internal/client/transaction.go @@ -85,7 +85,15 @@ func (t *Tx) execute( cmd string, sucessState txStatus, ) error { - q, err := newQuery("Execute", cmd, nil, txCapabilities, t.state, nil) + q, err := newQuery( + "Execute", + cmd, + nil, + txCapabilities, + t.state, + nil, + false, + ) if err != nil { return err } @@ -155,7 +163,15 @@ func (t *Tx) Execute( cmd string, args ...interface{}, ) error { - q, err := newQuery("Execute", cmd, args, t.capabilities1pX(), t.state, nil) + q, err := newQuery( + "Execute", + cmd, + args, + t.capabilities1pX(), + t.state, + nil, + true, + ) if err != nil { return err } diff --git a/internal/codecs/noop.go b/internal/codecs/noop.go index 858bfc8..669e304 100644 --- a/internal/codecs/noop.go +++ b/internal/codecs/noop.go @@ -24,6 +24,14 @@ import ( types "github.com/edgedb/edgedb-go/internal/edgedbtypes" ) +var ( + // NoOpDecoder is a noOpDecoder + NoOpDecoder = noOpDecoder{} + + // NoOpEncoder is a noOpEncoder + NoOpEncoder = noOpEncoder{} +) + // noOpDecoder decodes empty blocks i.e. does nothing. // // There is one special type with type id of zero: