POST whose body is a single SQL statement, and the engine returns the result in the response body. Any HTTP client works. This page describes that wire protocol: request format, output formats, session handling, transactions, and security.
For the endpoints you send to, the instance gateway or an engine’s own Service, see Connect to engines. The examples here reach an engine directly through its Service, so forward its port to your workstation:
System settings
Set system settings per query by appending them to the HTTP query string. For example, settimezone:
&):
Output format
Results are returned in the response body. By default they are a human-readable tab-separated string:output_format query-string parameter to choose another format. Use JSON_Compact when results are consumed by code rather than read by a human. The supported formats are:
TabSeparatedWithNamesAndTypes(default)JSON_CompactJSON_CompactLimited(same asJSON_Compact, capped at 10,000 rows)JSONLines_Compact(chunked version ofJSON_CompactLimited)
JSON_Compact returns one JSON document:
JSONLines_Compact returns newline-delimited messages:
Sessions
The protocol is stateless: the engine keeps no server-side session. Most statements need nothing more than a single request, but operations that carry state across statements, such as changing the current database or running an explicit transaction, need the client to maintain that state. The engine drives this through response headers and query-string parameters:- When a response carries
Firebolt-Update-Parameters: key=value, includekey=valuein the query string of every later request on the same connection. - When a response carries
Firebolt-Remove-Parameters: key, dropkeyfrom the query string of later requests.
Changing the current database
USE DATABASE validates that the database exists and returns a Firebolt-Update-Parameters: database=... header. Because there is no server-side state, the change takes effect only once you start sending that parameter:
Explicit transactions
BEGIN TRANSACTION returns a Firebolt-Update-Parameters: transaction_id=... header. Send that transaction_id on every later request to run inside the transaction. COMMIT or ROLLBACK returns Firebolt-Remove-Parameters: transaction_id, after which you stop sending it. See Explicit transactions.
Transactions
Every statement runs in its own transaction that commits when the statement finishes and rolls back when it fails. There can be any number of concurrent read transactions, but only one write transaction can be active across the whole engine at a time. Submitting a write while another write transaction is active returns an error, so a client that issues concurrent writes serializes them itself, for example through a queue.Security
A Firebolt engine’s HTTP endpoint has no built-in authentication or transport security:- Traffic is unencrypted HTTP. Anyone who can observe it reads everything exchanged, including secrets passed to reach external resources such as S3 or GCS.
- Requests are not authenticated and there is no role-based access control. Anyone who can reach the endpoint has full access to the engine.
Other ways to connect
Firebolt CLI
Thefb CLI (download from the releases page) speaks the same HTTP protocol. The --core preset targets localhost:3473 with no authentication, which matches a port-forwarded engine endpoint:
--host <hostname> to connect to a different host, or a query as a positional argument to run it and exit (fb --core 'SELECT 42').