tablelandnetwork / go-tableland

Go implementation of the Tableland database/validator - run your own node, handling on-chain events and serving read-queries
https://tableland.xyz/
MIT License
53 stars 10 forks source link

implements POST /query #612

Closed brunocalza closed 7 months ago

brunocalza commented 7 months ago

Summary

Implements the POST /query spec defined at https://github.com/tablelandnetwork/docs/pull/188

Working example on staging

curl -v --json '{"statement": "SELECT * FROM system_txn_receipts LIMIT 1"}' https://staging.tableland.network/api/v1/query

cc @dtbuchholz

Context

We're adding support for POST /query so queries can be sent via body request without the need of encoding the URL.

Implementation overview

Generates the code based on a new spec and implements the controller in a similar way to GET /query.