Skip to main content
POST
/
api
/
v1
/
warehouse
/
query
Query the lake
curl --request POST \
  --url https://oleander.dev/api/v1/warehouse/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "query": "WITH\n  src AS (\n    SELECT\n      *\n    FROM\n      read_json (\n        'https://api.tvmaze.com/search/shows?q=breaking+bad',\n        auto_detect = TRUE\n      )\n  )\nSELECT\n  src -> 'show' ->> 'name' AS show_name,\n  src -> 'show' ->> 'premiered' AS premiered,\n  src -> 'show' -> 'rating' ->> 'average' AS rating,\n  src -> 'show' -> 'network' ->> 'name' AS network_name\nFROM\n  src;",
  "autoSaveByHash": false
}
EOF
{
  "success": true,
  "results": {
    "columns": [
      "<string>"
    ],
    "column_types": [
      "<string>"
    ],
    "rows": [
      [
        "<unknown>"
      ]
    ]
  },
  "row_count": 123,
  "execution_time": "<string>",
  "query": "<string>",
  "job": {
    "namespace": "<string>",
    "name": "<string>"
  },
  "explainResult": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
string
required

The SQL query to execute. Supports all DuckDB SQL syntax.

Example:

"WITH\n src AS (\n SELECT\n *\n FROM\n read_json (\n 'https://api.tvmaze.com/search/shows?q=breaking+bad',\n auto_detect = TRUE\n )\n )\nSELECT\n src -> 'show' ->> 'name' AS show_name,\n src -> 'show' ->> 'premiered' AS premiered,\n src -> 'show' -> 'rating' ->> 'average' AS rating,\n src -> 'show' -> 'network' ->> 'name' AS network_name\nFROM\n src;"

autoSaveByHash
boolean
default:false

Automatically save query results to a table based on the query hash. If a table with the same hash exists, returns cached results instead of re-executing.

Response

Query executed successfully

success
boolean
required

Whether the query executed successfully

results
object
required

Query results with columns, column types, and rows

row_count
integer
required

Number of rows returned

execution_time
string
required

Query execution time (e.g., '991ms')

query
string
required

The original SQL query that was executed

job
object
required

Lineage job information

explainResult
object

Query execution plan explanation