diff --git a/testdata/base/sql/go.mod b/testdata/base/sql/go.mod index b95a80c..abd9b9a 100644 --- a/testdata/base/sql/go.mod +++ b/testdata/base/sql/go.mod @@ -6,10 +6,10 @@ require ( github.com/tarmac-project/protobuf-go v0.0.0-20241006222641-e31a4349f2b8 github.com/tarmac-project/tarmac/pkg/sdk v0.5.0 github.com/wapc/wapc-guest-tinygo v0.3.3 - google.golang.org/protobuf v1.35.1 ) require ( github.com/planetscale/vtprotobuf v0.6.0 // indirect github.com/valyala/fastjson v1.6.4 // indirect + google.golang.org/protobuf v1.35.1 // indirect ) diff --git a/testdata/base/sql/main.go b/testdata/base/sql/main.go index c552974..038d475 100644 --- a/testdata/base/sql/main.go +++ b/testdata/base/sql/main.go @@ -8,7 +8,6 @@ import ( wapc "github.com/wapc/wapc-guest-tinygo" "github.com/tarmac-project/protobuf-go/sdk/sql" - pb "google.golang.org/protobuf/proto" ) var tarmac *sdk.Tarmac @@ -26,7 +25,7 @@ func main() { func Handler(payload []byte) ([]byte, error) { // Create SQL Request query := &sql.SQLQuery{Query: []byte(`CREATE TABLE IF NOT EXISTS wasmguest ( id int NOT NULL, name varchar(255), PRIMARY KEY (id) );`)} - q, err := pb.Marshal(query) + q, err := query.MarshalVT() if err != nil { tarmac.Logger.Error(fmt.Sprintf("Unable to marshal SQL query - %s", err)) return []byte(""), fmt.Errorf(`Failed to marshal SQL query - %s`, err) @@ -41,7 +40,7 @@ func Handler(payload []byte) ([]byte, error) { // Unmarshal the response var response sql.SQLQueryResponse - err = pb.Unmarshal(rsp, &response) + err = response.UnmarshalVT(rsp) if err != nil { tarmac.Logger.Error(fmt.Sprintf("Unable to unmarshal SQL response - %s", err)) return []byte(""), fmt.Errorf(`Failed to unmarshal SQL response - %s`, err)