Introduction

Introduction to how to use SQL with Peaka.

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:

StatementREST APIDrivers
PREPARE, EXECUTE, DEALLOCATE PREPARENoYes
DESCRIBE INPUT, DESCRIBE OUTPUTNoYes
USENoYes
SET SESSION, RESET SESSIONNoYes
EXECUTE IMMEDIATEYesYes

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 bindings field, in the order of the ? placeholders. Each value is bound with its JSON type, so "statement": "SELECT 1 + ?", "bindings": [41] returns 42. You can also use EXECUTE IMMEDIATE.
  • Catalog and schema: write table names in full, as catalog.schema.table, instead of running USE.
  • Query time limit: set the request's timeout field (in seconds) instead of SET SESSION query_max_run_time.
success-mail-img

You've joined our email list. Our newsletter will be delivered to your inbox every other week, with news from Peaka and the no-code world, as well as updates on the latest trends and developments in the data integration space!

success-mail-img

Thank you for your interest. We'll contact you soon.