Expand description
Support for execute SQL queries using Apache Arrow Flight SQL.
Flight SQL is built on top of Arrow Flight RPC framework, by
defining specific messages, encoded using the protobuf format,
sent in theFlightDescriptor::cmd
field to FlightService
endpoints such asget_flight_info
and do_get
.
This module contains:
- prost generated structs for FlightSQL messages such as
CommandStatementQuery
- Helpers for encoding and decoding FlightSQL messages:
Any
andCommand
- A
FlightSqlServiceClient
for interacting with FlightSQL servers. - A
FlightSqlService
to help building FlightSQL servers fromFlightService
. - Helpers to build responses for FlightSQL metadata APIs:
metadata
Modules§
- client
- A FlightSQL Client
FlightSqlServiceClient
- gen 🔒
- metadata
- Builders and function for building responses to FlightSQL metadata / information schema requests.
- server
- Helper trait
FlightSqlService
for implementing aFlightService
that implements FlightSQL.
Macros§
- as_item 🔒
- Macro to coerce a token to an item, specifically
to build the
Commands
enum. - prost_
message_ 🔒ext
Structs§
- Action
Begin Savepoint Request - Request message for the “BeginSavepoint” action. Creates a savepoint within a transaction.
- Action
Begin Savepoint Result - The result of a “BeginSavepoint” action.
- Action
Begin Transaction Request - Request message for the “BeginTransaction” action. Begins a transaction.
- Action
Begin Transaction Result - The result of a “BeginTransaction” action.
- Action
Cancel Query Request - Request message for the “CancelQuery” action.
- Action
Cancel Query Result - The result of cancelling a query.
- Action
Close Prepared Statement Request - Request message for the “ClosePreparedStatement” action on a Flight SQL enabled backend. Closes server resources associated with the prepared statement handle.
- Action
Create Prepared Statement Request - Request message for the “CreatePreparedStatement” action on a Flight SQL enabled backend.
- Action
Create Prepared Statement Result - Wrap the result of a “CreatePreparedStatement” or “CreatePreparedSubstraitPlan” action.
- Action
Create Prepared Substrait Plan Request - Request message for the “CreatePreparedSubstraitPlan” action on a Flight SQL enabled backend.
- Action
EndSavepoint Request - Request message for the “EndSavepoint” action.
- Action
EndTransaction Request - Request message for the “EndTransaction” action.
- Any
- An implementation of the protobuf
Any
message type - Command
GetCatalogs - Represents a request to retrieve the list of catalogs on a Flight SQL enabled backend. The definition of a catalog depends on vendor/implementation. It is usually the database itself Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetCross Reference - Represents a request to retrieve a description of the foreign key columns in the given foreign key table that reference the primary key or the columns representing a unique constraint of the parent table (could be the same or a different table) on a Flight SQL enabled backend. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetDb Schemas - Represents a request to retrieve the list of database schemas on a Flight SQL enabled backend. The definition of a database schema depends on vendor/implementation. It is usually a collection of tables. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetExported Keys - Represents a request to retrieve a description of the foreign key columns that reference the given table’s primary key columns (the foreign keys exported by a table) of a table on a Flight SQL enabled backend. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetImported Keys - Represents a request to retrieve the foreign keys of a table on a Flight SQL enabled backend. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetPrimary Keys - Represents a request to retrieve the primary keys of a table on a Flight SQL enabled backend. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetSql Info - Represents a metadata request. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetTable Types - Represents a request to retrieve the list of table types on a Flight SQL enabled backend. The table types depend on vendor/implementation. It is usually used to separate tables from views or system tables. TABLE, VIEW, and SYSTEM TABLE are commonly supported. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetTables - Represents a request to retrieve the list of tables, and optionally their schemas, on a Flight SQL enabled backend. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
GetXdbc Type Info - Represents a request to retrieve information about data type supported on a Flight SQL enabled backend. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
Prepared Statement Query - Represents an instance of executing a prepared statement. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
Prepared Statement Update - Represents a SQL update query. Used in the command member of FlightDescriptor for the RPC call DoPut to cause the server to execute the included prepared statement handle as an update.
- Command
Statement Ingest - Represents a bulk ingestion request. Used in the command member of FlightDescriptor for the the RPC call DoPut to cause the server load the contents of the stream’s FlightData into the target destination.
- Command
Statement Query - Represents a SQL query. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
Statement Substrait Plan - Represents a Substrait plan. Used in the command member of FlightDescriptor for the following RPC calls:
- Command
Statement Update - Represents a SQL update query. Used in the command member of FlightDescriptor for the RPC call DoPut to cause the server to execute the included SQL update.
- DoPut
Prepared Statement Result - An optional response returned when
DoPut
is called withCommandPreparedStatementQuery
. - DoPut
Update Result - Returned from the RPC call DoPut when a CommandStatementUpdate, CommandPreparedStatementUpdate, or CommandStatementIngest was in the request, containing results from the update.
- Substrait
Plan - An embedded message describing a Substrait plan to execute.
- Table
Definition Options - Options for table definition behavior
- Ticket
Statement Query
Enums§
- Command
- Helper to convert to/from protobuf
Any
message to a specific FlightSQL command message. - EndTransaction
- Nullable
- Searchable
- SqlInfo
- Options for CommandGetSqlInfo.
- SqlNull
Ordering - SqlOuter
Joins Support Level - SqlSupported
Case Sensitivity - SqlSupported
Element Actions - SqlSupported
Group By - SqlSupported
Positioned Commands - SqlSupported
Result SetConcurrency - SqlSupported
Result SetType - SqlSupported
Subqueries - SqlSupported
Transaction - The level of support for Flight SQL transaction RPCs.
- SqlSupported
Transactions - SqlSupported
Unions - SqlSupports
Convert - SqlTransaction
Isolation Level - Supported
SqlGrammar - Table
Exists Option - The action to take if the target table already exists
- Table
NotExist Option - The action to take if the target table does not exist
- Update
Delete Rules - Xdbc
Data Type - Xdbc
Datetime Subcode
Constants§
- ACTION_
BEGIN_ 🔒SAVEPOINT_ REQUEST_ TYPE_ URL - ACTION_
BEGIN_ 🔒SAVEPOINT_ RESULT_ TYPE_ URL - ACTION_
BEGIN_ 🔒TRANSACTION_ REQUEST_ TYPE_ URL - ACTION_
BEGIN_ 🔒TRANSACTION_ RESULT_ TYPE_ URL - ACTION_
CANCEL_ 🔒QUERY_ REQUEST_ TYPE_ URL - ACTION_
CANCEL_ 🔒QUERY_ RESULT_ TYPE_ URL - ACTION_
CLOSE_ 🔒PREPARED_ STATEMENT_ REQUEST_ TYPE_ URL - ACTION_
CREATE_ 🔒PREPARED_ STATEMENT_ REQUEST_ TYPE_ URL - ACTION_
CREATE_ 🔒PREPARED_ STATEMENT_ RESULT_ TYPE_ URL - ACTION_
CREATE_ 🔒PREPARED_ SUBSTRAIT_ PLAN_ REQUEST_ TYPE_ URL - ACTION_
END_ 🔒SAVEPOINT_ REQUEST_ TYPE_ URL - ACTION_
END_ 🔒TRANSACTION_ REQUEST_ TYPE_ URL - COMMAND_
GET_ 🔒CATALOGS_ TYPE_ URL - COMMAND_
GET_ 🔒CROSS_ REFERENCE_ TYPE_ URL - COMMAND_
GET_ 🔒DB_ SCHEMAS_ TYPE_ URL - COMMAND_
GET_ 🔒EXPORTED_ KEYS_ TYPE_ URL - COMMAND_
GET_ 🔒IMPORTED_ KEYS_ TYPE_ URL - COMMAND_
GET_ 🔒PRIMARY_ KEYS_ TYPE_ URL - COMMAND_
GET_ 🔒SQL_ INFO_ TYPE_ URL - COMMAND_
GET_ 🔒TABLES_ TYPE_ URL - COMMAND_
GET_ 🔒TABLE_ TYPES_ TYPE_ URL - COMMAND_
GET_ 🔒XDBC_ TYPE_ INFO_ TYPE_ URL - COMMAND_
PREPARED_ 🔒STATEMENT_ QUERY_ TYPE_ URL - COMMAND_
PREPARED_ 🔒STATEMENT_ UPDATE_ TYPE_ URL - COMMAND_
STATEMENT_ 🔒INGEST_ TYPE_ URL - COMMAND_
STATEMENT_ 🔒QUERY_ TYPE_ URL - COMMAND_
STATEMENT_ 🔒SUBSTRAIT_ PLAN_ TYPE_ URL - COMMAND_
STATEMENT_ 🔒UPDATE_ TYPE_ URL - DO_
PUT_ 🔒PREPARED_ STATEMENT_ RESULT_ TYPE_ URL - DO_
PUT_ 🔒UPDATE_ RESULT_ TYPE_ URL - TICKET_
STATEMENT_ 🔒QUERY_ TYPE_ URL
Traits§
- Prost
Message Ext - ProstMessageExt are useful utility methods for prost::Message types