Skip to main content
POST
/
api
/
v1
/
query
/
postgres
Query PostgreSQL
curl --request POST \
  --url http://localhost:8080/api/v1/query/postgres \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "sql": "SELECT * FROM test.stock_price WHERE volume > 1000000",
  "database": "datris",
  "limit": 100
}
'
{
  "results": [
    {}
  ],
  "count": 123
}

Authorizations

x-api-key
string
header
required

Optional API key for authentication (enabled via application.yaml)

Body

application/json
sql
string
required

SQL SELECT query to execute

Example:

"SELECT * FROM test.stock_price WHERE volume > 1000000"

database
string
default:datris

PostgreSQL database name

limit
integer
default:100

Maximum rows to return (max 1000)

Response

Query results

results
object[]
count
integer