Documentation
¶
Overview ¶
Package trino provides a Trino implementation of the query provider.
Index ¶
- type Adapter
- func (a *Adapter) Close() error
- func (a *Adapter) GetExecutionContext(ctx context.Context, urns []string) (*query.ExecutionContext, error)
- func (a *Adapter) GetQueryExamples(ctx context.Context, urn string) ([]query.QueryExample, error)
- func (a *Adapter) GetTableAvailability(ctx context.Context, urn string) (*query.TableAvailability, error)
- func (a *Adapter) GetTableSchema(ctx context.Context, table query.TableIdentifier) (*query.TableSchema, error)
- func (a *Adapter) Name() string
- func (a *Adapter) Ping(ctx context.Context) error
- func (a *Adapter) ResolveTable(_ context.Context, urn string) (*query.TableIdentifier, error)
- type Client
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements query.Provider using Trino.
func NewWithClient ¶
NewWithClient creates a new Trino adapter with a provided client (for testing).
func (*Adapter) GetExecutionContext ¶
func (a *Adapter) GetExecutionContext(ctx context.Context, urns []string) (*query.ExecutionContext, error)
GetExecutionContext returns context for querying multiple tables.
func (*Adapter) GetQueryExamples ¶
GetQueryExamples returns sample queries for a table.
func (*Adapter) GetTableAvailability ¶
func (a *Adapter) GetTableAvailability(ctx context.Context, urn string) (*query.TableAvailability, error)
GetTableAvailability checks if a table is queryable.
func (*Adapter) GetTableSchema ¶
func (a *Adapter) GetTableSchema(ctx context.Context, table query.TableIdentifier) (*query.TableSchema, error)
GetTableSchema returns the schema of a table.
func (*Adapter) ResolveTable ¶
ResolveTable converts a URN to a table identifier.
type Client ¶
type Client interface {
Query(ctx context.Context, sql string, opts trinoclient.QueryOptions) (*trinoclient.QueryResult, error)
ListCatalogs(ctx context.Context) ([]string, error)
ListSchemas(ctx context.Context, catalog string) ([]string, error)
ListTables(ctx context.Context, catalog, schema string) ([]trinoclient.TableInfo, error)
DescribeTable(ctx context.Context, catalog, schema, table string) (*trinoclient.TableInfo, error)
Ping(ctx context.Context) error
Close() error
}
Client defines the interface for Trino operations. This allows for mocking in tests.
Click to show internal directories.
Click to hide internal directories.