Documentation ¶
Index ¶
- Constants
- func CreateHub() error
- type Hub
- type HubLocal
- func (h *HubLocal) Abort()
- func (h *HubLocal) AddScanMetadata(i Iterator)
- func (h *HubLocal) ApplySetting(key string, value string) error
- func (h *HubLocal) Close()
- func (h *HubLocal) EndScan(iter Iterator, limit int64)
- func (h *HubLocal) Explain(columns []string, quals []*proto.Qual, sortKeys []string, verbose bool, ...) ([]string, error)
- func (l *HubLocal) GetConnectionConfigByName(name string) *proto.ConnectionConfig
- func (l *HubLocal) GetIterator(columns []string, quals *proto.Quals, unhandledRestrictions int, limit int64, ...) (Iterator, error)
- func (h *HubLocal) GetLegacySettingsSchema() map[string]*proto.TableSchema
- func (l *HubLocal) GetPathKeys(opts types.Options) ([]types.PathKey, error)
- func (h *HubLocal) GetRelSize(columns []string, quals []*proto.Qual, opts types.Options) (types.RelSize, error)
- func (l *HubLocal) GetSchema(_, connectionName string) (*proto.Schema, error)
- func (h *HubLocal) GetSettingsSchema() map[string]*proto.TableSchema
- func (h *HubLocal) GetSortableFields(tableName, connectionName string) map[string]proto.SortOrder
- func (h *HubLocal) HandleLegacyCacheCommand(command string) error
- func (l *HubLocal) LoadConnectionConfig() (bool, error)
- func (l *HubLocal) ProcessImportForeignSchemaOptions(opts types.Options, connection string) error
- func (h *HubLocal) RemoveIterator(iterator Iterator)
- func (l *HubLocal) SetConnectionConfig(connectionName, configString string) error
- func (h *HubLocal) StartScan(i Iterator) error
- func (l *HubLocal) UpdateConnectionConfig(connectionName, configString string) error
- func (h *HubLocal) ValidateCacheCommand(command string) error
- type Iterator
- type QueryResult
- type RemoteHub
- func (h *RemoteHub) Abort()
- func (h *RemoteHub) AddScanMetadata(i Iterator)
- func (h *RemoteHub) ApplySetting(key string, value string) error
- func (h *RemoteHub) Close()
- func (h *RemoteHub) EndScan(iter Iterator, limit int64)
- func (h *RemoteHub) Explain(columns []string, quals []*proto.Qual, sortKeys []string, verbose bool, ...) ([]string, error)
- func (h *RemoteHub) GetConnectionConfigByName(string) *proto.ConnectionConfig
- func (h *RemoteHub) GetIterator(columns []string, quals *proto.Quals, unhandledRestrictions int, limit int64, ...) (Iterator, error)
- func (h *RemoteHub) GetLegacySettingsSchema() map[string]*proto.TableSchema
- func (h *RemoteHub) GetPathKeys(opts types.Options) ([]types.PathKey, error)
- func (h *RemoteHub) GetRelSize(columns []string, quals []*proto.Qual, opts types.Options) (types.RelSize, error)
- func (h *RemoteHub) GetSchema(remoteSchema string, localSchema string) (*proto.Schema, error)
- func (h *RemoteHub) GetSettingsSchema() map[string]*proto.TableSchema
- func (h *RemoteHub) GetSortableFields(tableName, connectionName string) map[string]proto.SortOrder
- func (h *RemoteHub) HandleLegacyCacheCommand(command string) error
- func (h *RemoteHub) LoadConnectionConfig() (bool, error)
- func (h *RemoteHub) ProcessImportForeignSchemaOptions(types.Options, string) error
- func (h *RemoteHub) RemoveIterator(iterator Iterator)
- func (h *RemoteHub) StartScan(i Iterator) error
- func (h *RemoteHub) ValidateCacheCommand(command string) error
Constants ¶
const ( QueryStatusReady queryStatus = "ready" QueryStatusStarted queryStatus = "started" QueryStatusError queryStatus = "error" QueryStatusComplete queryStatus = "complete" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Hub ¶
type Hub interface { GetConnectionConfigByName(string) *proto.ConnectionConfig LoadConnectionConfig() (bool, error) GetSchema(remoteSchema string, localSchema string) (*proto.Schema, error) GetIterator(columns []string, quals *proto.Quals, unhandledRestrictions int, limit int64, sortOrder []*proto.SortColumn, queryTimestamp int64, opts types.Options) (Iterator, error) GetRelSize(columns []string, quals []*proto.Qual, opts types.Options) (types.RelSize, error) GetPathKeys(opts types.Options) ([]types.PathKey, error) Explain(columns []string, quals []*proto.Qual, sortKeys []string, verbose bool, opts types.Options) ([]string, error) ApplySetting(key string, value string) error GetSettingsSchema() map[string]*proto.TableSchema GetLegacySettingsSchema() map[string]*proto.TableSchema StartScan(i Iterator) error RemoveIterator(iterator Iterator) EndScan(iter Iterator, limit int64) AddScanMetadata(iter Iterator) Abort() Close() ProcessImportForeignSchemaOptions(opts types.Options, connectionName string) error HandleLegacyCacheCommand(command string) error ValidateCacheCommand(command string) error GetSortableFields(table, connection string) map[string]proto.SortOrder // contains filtered or unexported methods }
TODO check which can be non-imported
type HubLocal ¶ added in v1.11.0
type HubLocal struct {
// contains filtered or unexported fields
}
func (*HubLocal) Abort ¶ added in v1.11.0
func (h *HubLocal) Abort()
Abort shuts down currently running queries
func (*HubLocal) AddScanMetadata ¶ added in v1.11.0
func (h *HubLocal) AddScanMetadata(i Iterator)
AddScanMetadata adds the scan metadata from the given iterator to the hubs array we append to this every time a scan completes (either due to end of data, or Postgres terminating) the full array is returned whenever a pop_scan_metadata command is received and the array is cleared
func (*HubLocal) ApplySetting ¶ added in v1.11.0
func (*HubLocal) Close ¶ added in v1.11.0
func (h *HubLocal) Close()
Close shuts down all plugin clients
func (*HubLocal) EndScan ¶ added in v1.11.0
EndScan is called when Postgres terminates the scan (because it has received enough rows of data)
func (*HubLocal) Explain ¶ added in v1.11.0
func (h *HubLocal) Explain(columns []string, quals []*proto.Qual, sortKeys []string, verbose bool, opts types.Options) ([]string, error)
Explain :: hook called on explain.
Returns: An iterable of strings to display in the EXPLAIN output.
func (*HubLocal) GetConnectionConfigByName ¶ added in v1.11.0
func (l *HubLocal) GetConnectionConfigByName(name string) *proto.ConnectionConfig
func (*HubLocal) GetIterator ¶ added in v1.11.0
func (*HubLocal) GetLegacySettingsSchema ¶ added in v1.11.0
func (h *HubLocal) GetLegacySettingsSchema() map[string]*proto.TableSchema
func (*HubLocal) GetPathKeys ¶ added in v1.11.0
func (*HubLocal) GetRelSize ¶ added in v1.11.0
func (h *HubLocal) GetRelSize(columns []string, quals []*proto.Qual, opts types.Options) (types.RelSize, error)
GetRelSize is a method called from the planner to estimate the resulting relation size for a scan.
It will help the planner in deciding between different types of plans, according to their costs. Args: columns (list): The list of columns that must be returned. quals (list): A list of Qual instances describing the filters applied to this scan. Returns: A struct of the form (expected_number_of_rows, avg_row_width (in bytes))
func (*HubLocal) GetSettingsSchema ¶ added in v1.11.0
func (h *HubLocal) GetSettingsSchema() map[string]*proto.TableSchema
func (*HubLocal) GetSortableFields ¶ added in v1.11.0
GetSortableFields
func (*HubLocal) HandleLegacyCacheCommand ¶ added in v1.11.0
func (*HubLocal) LoadConnectionConfig ¶ added in v1.11.0
func (*HubLocal) ProcessImportForeignSchemaOptions ¶ added in v1.11.0
func (*HubLocal) RemoveIterator ¶ added in v1.11.0
func (h *HubLocal) RemoveIterator(iterator Iterator)
RemoveIterator removes an iterator from list of running iterators
func (*HubLocal) SetConnectionConfig ¶ added in v1.11.0
func (*HubLocal) UpdateConnectionConfig ¶ added in v1.11.0
func (*HubLocal) ValidateCacheCommand ¶ added in v1.11.0
type Iterator ¶
type Iterator interface { // GetConnectionName returns the connection name that this iterator uses. GetConnectionName() string GetPluginName() string // Next returns a row. Nil slice means there is no more rows to scan. Next() (map[string]interface{}, error) // Close stops an iteration and frees any resources. Close() Status() queryStatus Error() error CanIterate() bool GetQueryTimestamp() int64 GetTraceContext() *telemetry.TraceCtx }
Iterator is an interface for table scanner implementations.
type QueryResult ¶ added in v1.3.0
type QueryResult struct {
Rows []map[string]interface{}
}
func (*QueryResult) Append ¶ added in v1.3.0
func (q *QueryResult) Append(row map[string]interface{})
type RemoteHub ¶ added in v1.11.0
type RemoteHub struct {
// contains filtered or unexported fields
}
RemoteHub is a structure representing plugin hub
func (*RemoteHub) Abort ¶ added in v1.11.0
func (h *RemoteHub) Abort()
Abort shuts down currently running queries
func (*RemoteHub) AddScanMetadata ¶ added in v1.11.0
func (h *RemoteHub) AddScanMetadata(i Iterator)
AddScanMetadata adds the scan metadata from the given iterator to the hubs array we append to this every time a scan completes (either due to end of data, or Postgres terminating) the full array is returned whenever a pop_scan_metadata command is received and the array is cleared
func (*RemoteHub) ApplySetting ¶ added in v1.11.0
func (*RemoteHub) Close ¶ added in v1.11.0
func (h *RemoteHub) Close()
Close shuts down all plugin clients
func (*RemoteHub) EndScan ¶ added in v1.11.0
EndScan is called when Postgres terminates the scan (because it has received enough rows of data)
func (*RemoteHub) Explain ¶ added in v1.11.0
func (h *RemoteHub) Explain(columns []string, quals []*proto.Qual, sortKeys []string, verbose bool, opts types.Options) ([]string, error)
Explain :: hook called on explain.
Returns: An iterable of strings to display in the EXPLAIN output.
func (*RemoteHub) GetConnectionConfigByName ¶ added in v1.11.0
func (h *RemoteHub) GetConnectionConfigByName(string) *proto.ConnectionConfig
func (*RemoteHub) GetIterator ¶ added in v1.11.0
func (h *RemoteHub) GetIterator(columns []string, quals *proto.Quals, unhandledRestrictions int, limit int64, sortOrder []*proto.SortColumn, queryTimestamp int64, opts types.Options) (Iterator, error)
GetIterator creates and returns an iterator
func (*RemoteHub) GetLegacySettingsSchema ¶ added in v1.11.0
func (h *RemoteHub) GetLegacySettingsSchema() map[string]*proto.TableSchema
func (*RemoteHub) GetPathKeys ¶ added in v1.11.0
GetPathKeys Is a method called from the planner to add additional Path to the planner.
fetch schema and call base implementation
func (*RemoteHub) GetRelSize ¶ added in v1.11.0
func (h *RemoteHub) GetRelSize(columns []string, quals []*proto.Qual, opts types.Options) (types.RelSize, error)
GetRelSize is a method called from the planner to estimate the resulting relation size for a scan.
It will help the planner in deciding between different types of plans, according to their costs. Args: columns (list): The list of columns that must be returned. quals (list): A list of Qual instances describing the filters applied to this scan. Returns: A struct of the form (expected_number_of_rows, avg_row_width (in bytes))
func (*RemoteHub) GetSchema ¶ added in v1.11.0
GetSchema returns the schema for a name. Load the plugin for the connection if needed
func (*RemoteHub) GetSettingsSchema ¶ added in v1.11.0
func (h *RemoteHub) GetSettingsSchema() map[string]*proto.TableSchema
func (*RemoteHub) GetSortableFields ¶ added in v1.11.0
GetSortableFields returns a slice of fields which are defined as sortable bythe plugin schema, as well as the sort order(s) supported
func (*RemoteHub) HandleLegacyCacheCommand ¶ added in v1.11.0
func (*RemoteHub) LoadConnectionConfig ¶ added in v1.11.0
LoadConnectionConfig loads the connection config and returns whether it has changed
func (*RemoteHub) ProcessImportForeignSchemaOptions ¶ added in v1.11.0
func (*RemoteHub) RemoveIterator ¶ added in v1.11.0
func (h *RemoteHub) RemoveIterator(iterator Iterator)
RemoveIterator removes an iterator from list of running iterators