Welcome
Peaka uses Trino's ANSI SQL compliant query engine. This standard compliance allows Peaka users to integrate their favorite data tools, including BI and ETL tools with any underlying data source.
Our query engine validates and translates the received SQL statements into the necessary operations on the connected data source.
This section provides a reference to the supported SQL data types and other general characteristics of the SQL support of Peaka.
REST API and drivers
You can send SQL to Peaka through the REST API (the
queries/execute endpoint) or through a database driver
(JDBC, Python or Node.js). The two differ in one way: the REST API is
stateless. Every request stands alone, and nothing is kept between requests.
A driver keeps a session open for the life of its connection, so statements that set up state for later statements work there, and not through the REST API:
| Statement | REST API | Drivers |
|---|---|---|
PREPARE, EXECUTE, DEALLOCATE PREPARE | No | Yes |
DESCRIBE INPUT, DESCRIBE OUTPUT | No | Yes |
| USE | No | Yes |
SET SESSION, RESET SESSION | No | Yes |
| EXECUTE IMMEDIATE | Yes | Yes |
Through the REST API these statements are rejected with a message saying the statement needs a session and should be run through a driver.
With the REST API, use these instead:
- Parameters: pass the values in the request's
bindingsfield, in the order of the?placeholders. Each value is bound with its JSON type, so"statement": "SELECT 1 + ?", "bindings": [41]returns42. You can also use EXECUTE IMMEDIATE. - Catalog and schema: write table names in full, as
catalog.schema.table, instead of runningUSE. - Query time limit: set the request's
timeoutfield (in seconds) instead ofSET SESSION query_max_run_time.