Skip to main content

Flight SQL API

Gnok implements the Arrow Flight SQL specification for high-throughput SQL execution over gRPC.

Endpoint​

Use the Flight SQL endpoint provided for your organization, with TLS. For a URI-based Arrow client the shape is grpc+tls://<host>:<port>. Flight SQL access from outside Studio isn't self-service yet; email support@gnok.io to request it. See connectivity.

Supported Actions​

ActionDescription
CommandStatementQueryExecute a SQL query and stream results
CommandStatementUpdateExecute a DML statement and return affected row count
CommandStatementIngestData ingestion
CommandStatementSubstraitPlanExecute a Substrait plan
CommandGetCatalogsList available catalogs
CommandGetDbSchemasList schemas in a catalog
CommandGetTablesList tables in a schema
CommandGetTableTypesList supported table types
CommandGetPrimaryKeysGet primary key constraints
CommandGetImportedKeysGet imported keys
CommandGetExportedKeysGet exported keys
CommandGetCrossReferenceGet cross-references
CommandGetXdbcTypeInfoGet type information
CommandGetSqlInfoGet SQL metadata
CommandPreparedStatementQueryExecute a prepared SELECT
CommandPreparedStatementUpdateExecute a prepared DML
ActionCreatePreparedStatementCreate a prepared statement
ActionClosePreparedStatementClose a prepared statement
ActionBeginTransactionBegin a transaction
ActionEndTransactionCommit or rollback a transaction
ActionCancelQueryCancel a running query
ActionBeginSavepointCreate a savepoint
ActionEndSavepointRelease or rollback a savepoint

Authentication​

Use the Flight SQL handshake to pass a bearer token:

Authorization: Bearer <jwt-token>

Session headers x-gnok-session-id, snapshot mode, and TTL are extracted from the handshake metadata.

Data Format​

Results are streamed as Arrow IPC record batches in columnar format for zero-copy consumption.

Error Handling​

Errors are returned as gRPC status codes:

CodeMeaning
INVALID_ARGUMENTSQL syntax error or invalid parameters
NOT_FOUNDTable or schema does not exist
PERMISSION_DENIEDInsufficient privileges
RESOURCE_EXHAUSTEDQuery exceeded memory or time limits
INTERNALUnexpected engine error