Documentation ¶
Overview ¶
Package sqlv2 : Operations and models for the SqlV2 service
Index ¶
- Constants
- func GetServiceURLForRegion(region string) (string, error)
- func UnmarshalColumnInformation(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalSqlJobInfoFull(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalSqlJobInfoList(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalSqlJobInfoShort(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalTableInformation(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalTableList(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalTableMetadata(m map[string]json.RawMessage, result interface{}) (err error)
- type ColumnInformation
- type GetSqlJobOptions
- type GetTableOptions
- type ListSqlJobsOptions
- type ListTablesOptions
- type SqlJobInfoFull
- type SqlJobInfoList
- type SqlJobInfoShort
- type SqlV2
- func (sql *SqlV2) Clone() *SqlV2
- func (sql *SqlV2) DisableRetries()
- func (sql *SqlV2) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
- func (sql *SqlV2) GetEnableGzipCompression() bool
- func (sql *SqlV2) GetServiceURL() string
- func (sql *SqlV2) GetSqlJob(getSqlJobOptions *GetSqlJobOptions) (result *SqlJobInfoFull, response *core.DetailedResponse, err error)
- func (sql *SqlV2) GetSqlJobWithContext(ctx context.Context, getSqlJobOptions *GetSqlJobOptions) (result *SqlJobInfoFull, response *core.DetailedResponse, err error)
- func (sql *SqlV2) GetTable(getTableOptions *GetTableOptions) (result *TableInformation, response *core.DetailedResponse, err error)
- func (sql *SqlV2) GetTableWithContext(ctx context.Context, getTableOptions *GetTableOptions) (result *TableInformation, response *core.DetailedResponse, err error)
- func (sql *SqlV2) ListSqlJobs(listSqlJobsOptions *ListSqlJobsOptions) (result *SqlJobInfoList, response *core.DetailedResponse, err error)
- func (sql *SqlV2) ListSqlJobsWithContext(ctx context.Context, listSqlJobsOptions *ListSqlJobsOptions) (result *SqlJobInfoList, response *core.DetailedResponse, err error)
- func (sql *SqlV2) ListTables(listTablesOptions *ListTablesOptions) (result *TableList, response *core.DetailedResponse, err error)
- func (sql *SqlV2) ListTablesWithContext(ctx context.Context, listTablesOptions *ListTablesOptions) (result *TableList, response *core.DetailedResponse, err error)
- func (*SqlV2) NewGetSqlJobOptions(jobID string) *GetSqlJobOptions
- func (*SqlV2) NewGetTableOptions(tableName string) *GetTableOptions
- func (*SqlV2) NewListSqlJobsOptions() *ListSqlJobsOptions
- func (*SqlV2) NewListTablesOptions() *ListTablesOptions
- func (*SqlV2) NewSubmitSqlJobOptions(statement string) *SubmitSqlJobOptions
- func (sql *SqlV2) SetDefaultHeaders(headers http.Header)
- func (sql *SqlV2) SetEnableGzipCompression(enableGzip bool)
- func (sql *SqlV2) SetServiceURL(url string) error
- func (sql *SqlV2) SubmitSqlJob(submitSqlJobOptions *SubmitSqlJobOptions) (result *SqlJobInfoShort, response *core.DetailedResponse, err error)
- func (sql *SqlV2) SubmitSqlJobWithContext(ctx context.Context, submitSqlJobOptions *SubmitSqlJobOptions) (result *SqlJobInfoShort, response *core.DetailedResponse, err error)
- type SqlV2Options
- type SubmitSqlJobOptions
- type TableInformation
- type TableList
- type TableMetadata
Constants ¶
const ( SqlJobInfoFull_Status_Completed = "completed" SqlJobInfoFull_Status_Failed = "failed" SqlJobInfoFull_Status_Queued = "queued" SqlJobInfoFull_Status_Running = "running" )
Constants associated with the SqlJobInfoFull.Status property. Execution status of an SQL job.
const ( SqlJobInfoShort_Status_Completed = "completed" SqlJobInfoShort_Status_Failed = "failed" SqlJobInfoShort_Status_Queued = "queued" SqlJobInfoShort_Status_Running = "running" )
Constants associated with the SqlJobInfoShort.Status property. Execution status of an SQL job.
const DefaultServiceName = "sql"
DefaultServiceName is the default key used to find external configuration information.
const DefaultServiceURL = "https://api.sql-query.cloud.ibm.com/v2"
DefaultServiceURL is the default URL to make service requests to.
Variables ¶
This section is empty.
Functions ¶
func GetServiceURLForRegion ¶
GetServiceURLForRegion returns the service URL to be used for the specified region
func UnmarshalColumnInformation ¶
func UnmarshalColumnInformation(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalColumnInformation unmarshals an instance of ColumnInformation from the specified map of raw messages.
func UnmarshalSqlJobInfoFull ¶
func UnmarshalSqlJobInfoFull(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalSqlJobInfoFull unmarshals an instance of SqlJobInfoFull from the specified map of raw messages.
func UnmarshalSqlJobInfoList ¶
func UnmarshalSqlJobInfoList(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalSqlJobInfoList unmarshals an instance of SqlJobInfoList from the specified map of raw messages.
func UnmarshalSqlJobInfoShort ¶
func UnmarshalSqlJobInfoShort(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalSqlJobInfoShort unmarshals an instance of SqlJobInfoShort from the specified map of raw messages.
func UnmarshalTableInformation ¶
func UnmarshalTableInformation(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalTableInformation unmarshals an instance of TableInformation from the specified map of raw messages.
func UnmarshalTableList ¶
func UnmarshalTableList(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalTableList unmarshals an instance of TableList from the specified map of raw messages.
func UnmarshalTableMetadata ¶
func UnmarshalTableMetadata(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalTableMetadata unmarshals an instance of TableMetadata from the specified map of raw messages.
Types ¶
type ColumnInformation ¶
type ColumnInformation struct { // The name of the column. Name *string `json:"name" validate:"required"` // The data type of the column. Type *string `json:"type" validate:"required"` // Whether the column may contain NULL values. Nullable *bool `json:"nullable,omitempty"` }
ColumnInformation : Information about a table column.
type GetSqlJobOptions ¶
type GetSqlJobOptions struct { // ID of the SQL job for which information is to be retrieved. This ID is returned when an SQL job is submitted, and // when information about recently submitted SQL jobs is requested. JobID *string `validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string }
GetSqlJobOptions : The GetSqlJob options.
func (*GetSqlJobOptions) SetHeaders ¶
func (options *GetSqlJobOptions) SetHeaders(param map[string]string) *GetSqlJobOptions
SetHeaders : Allow user to set Headers
func (*GetSqlJobOptions) SetJobID ¶
func (options *GetSqlJobOptions) SetJobID(jobID string) *GetSqlJobOptions
SetJobID : Allow user to set JobID
type GetTableOptions ¶
type GetTableOptions struct { // Name of the catalog table for which information is to be retrieved. Table names are case-insensitive and must only // contain alphabetic and numeral characters, and underscore (_). TableName *string `validate:"required,ne="` // Allows users to set headers on API requests Headers map[string]string }
GetTableOptions : The GetTable options.
func (*GetTableOptions) SetHeaders ¶
func (options *GetTableOptions) SetHeaders(param map[string]string) *GetTableOptions
SetHeaders : Allow user to set Headers
func (*GetTableOptions) SetTableName ¶
func (options *GetTableOptions) SetTableName(tableName string) *GetTableOptions
SetTableName : Allow user to set TableName
type ListSqlJobsOptions ¶
type ListSqlJobsOptions struct { // Allows users to set headers on API requests Headers map[string]string }
ListSqlJobsOptions : The ListSqlJobs options.
func (*ListSqlJobsOptions) SetHeaders ¶
func (options *ListSqlJobsOptions) SetHeaders(param map[string]string) *ListSqlJobsOptions
SetHeaders : Allow user to set Headers
type ListTablesOptions ¶
type ListTablesOptions struct { // A table name pattern for filtering the tables that should be listed. The pattern follows Hive syntax conventions and // can include asterisks as wildcards and vertical bars to separate alternatives. NamePattern *string // A table type for filtering the tables that should be listed, can be "table" or "view". Type *string // Allows users to set headers on API requests Headers map[string]string }
ListTablesOptions : The ListTables options.
func (*ListTablesOptions) SetHeaders ¶
func (options *ListTablesOptions) SetHeaders(param map[string]string) *ListTablesOptions
SetHeaders : Allow user to set Headers
func (*ListTablesOptions) SetNamePattern ¶
func (options *ListTablesOptions) SetNamePattern(namePattern string) *ListTablesOptions
SetNamePattern : Allow user to set NamePattern
func (*ListTablesOptions) SetType ¶
func (options *ListTablesOptions) SetType(typeVar string) *ListTablesOptions
SetType : Allow user to set Type
type SqlJobInfoFull ¶
type SqlJobInfoFull struct { // Identifier for an SQL job. JobID *string `json:"job_id" validate:"required"` // Execution status of an SQL job. Status *string `json:"status" validate:"required"` // ID of the user who submitted an SQL job. UserID *string `json:"user_id" validate:"required"` // Timestamp indicating when an SQL job was accepted by the service. SubmitTime *strfmt.DateTime `json:"submit_time" validate:"required"` // The SQL query that the job processes. Statement *string `json:"statement" validate:"required"` // The service plan id of the instance. PlanID *string `json:"plan_id,omitempty"` // Format of the query result. ResultsetFormat *string `json:"resultset_format,omitempty"` // A URI that indicates where the query result is stored. This URI can be used as input for another SQL query. The // result comprises all objects that have a name with this URI as its prefix. ResultsetLocation *string `json:"resultset_location,omitempty"` // Timestamp indicating when the job finished processing. EndTime *strfmt.DateTime `json:"end_time,omitempty"` // Number of rows returned. RowsReturned *float64 `json:"rows_returned,omitempty"` // Number of rows read. RowsRead *float64 `json:"rows_read,omitempty"` // Number of bytes read. BytesRead *float64 `json:"bytes_read,omitempty"` // Number of objects skipped using index management.(Optional). ObjectsSkipped *float64 `json:"objects_skipped,omitempty"` // Number of objects qualified using index management.(Optional). ObjectsQualified *float64 `json:"objects_qualified,omitempty"` // An error that was encountered while processing the job. Error *string `json:"error,omitempty"` // Detailed information about the error. ErrorMessage *string `json:"error_message,omitempty"` // Suggests possible optimizations for a query. Hints []string `json:"hints,omitempty"` }
SqlJobInfoFull : Full information about an SQL job, including output or error information.
type SqlJobInfoList ¶
type SqlJobInfoList struct { // The SQL jobs. Jobs []SqlJobInfoShort `json:"jobs" validate:"required"` }
SqlJobInfoList : List of information about SQL jobs.
type SqlJobInfoShort ¶
type SqlJobInfoShort struct { // Identifier for an SQL job. JobID *string `json:"job_id" validate:"required"` // Execution status of an SQL job. Status *string `json:"status" validate:"required"` // ID of the user who submitted an SQL job. UserID *string `json:"user_id,omitempty"` // Timestamp indicating when an SQL job was accepted by the service. SubmitTime *strfmt.DateTime `json:"submit_time,omitempty"` // Boolean indicating when an SQL job has an improvement hint. HasHints *bool `json:"has_hints,omitempty"` }
SqlJobInfoShort : Abridged information about an SQL job, including its identifier and processing status.
type SqlV2 ¶
type SqlV2 struct { Service *core.BaseService // The cloud resource name (CRN) of the SQL query service instance. InstanceCrn *string }
SqlV2 : SQL Query is a stateless service for analyzing rectangular data stored in IBM Cloud Object Store using ANSI SQL.
Version: 2.0
func NewSqlV2 ¶
func NewSqlV2(options *SqlV2Options) (service *SqlV2, err error)
NewSqlV2 : constructs an instance of SqlV2 with passed in options.
func NewSqlV2UsingExternalConfig ¶
func NewSqlV2UsingExternalConfig(options *SqlV2Options) (sql *SqlV2, err error)
NewSqlV2UsingExternalConfig : constructs an instance of SqlV2 with passed in options and external configuration.
func (*SqlV2) DisableRetries ¶
func (sql *SqlV2) DisableRetries()
DisableRetries disables automatic retries for requests invoked for this service instance.
func (*SqlV2) EnableRetries ¶
EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.
func (*SqlV2) GetEnableGzipCompression ¶
GetEnableGzipCompression returns the service's EnableGzipCompression field
func (*SqlV2) GetServiceURL ¶
GetServiceURL returns the service URL
func (*SqlV2) GetSqlJob ¶
func (sql *SqlV2) GetSqlJob(getSqlJobOptions *GetSqlJobOptions) (result *SqlJobInfoFull, response *core.DetailedResponse, err error)
GetSqlJob : Get information about a specific SQL job Returns information about the specified SQL job.
func (*SqlV2) GetSqlJobWithContext ¶
func (sql *SqlV2) GetSqlJobWithContext(ctx context.Context, getSqlJobOptions *GetSqlJobOptions) (result *SqlJobInfoFull, response *core.DetailedResponse, err error)
GetSqlJobWithContext is an alternate form of the GetSqlJob method which supports a Context parameter
func (*SqlV2) GetTable ¶
func (sql *SqlV2) GetTable(getTableOptions *GetTableOptions) (result *TableInformation, response *core.DetailedResponse, err error)
GetTable : Get information about a specific catalog table Returns information about the specified catalog table.
func (*SqlV2) GetTableWithContext ¶
func (sql *SqlV2) GetTableWithContext(ctx context.Context, getTableOptions *GetTableOptions) (result *TableInformation, response *core.DetailedResponse, err error)
GetTableWithContext is an alternate form of the GetTable method which supports a Context parameter
func (*SqlV2) ListSqlJobs ¶
func (sql *SqlV2) ListSqlJobs(listSqlJobsOptions *ListSqlJobsOptions) (result *SqlJobInfoList, response *core.DetailedResponse, err error)
ListSqlJobs : Get information about recent SQL jobs Returns information about recently submitted SQL jobs.
func (*SqlV2) ListSqlJobsWithContext ¶
func (sql *SqlV2) ListSqlJobsWithContext(ctx context.Context, listSqlJobsOptions *ListSqlJobsOptions) (result *SqlJobInfoList, response *core.DetailedResponse, err error)
ListSqlJobsWithContext is an alternate form of the ListSqlJobs method which supports a Context parameter
func (*SqlV2) ListTables ¶
func (sql *SqlV2) ListTables(listTablesOptions *ListTablesOptions) (result *TableList, response *core.DetailedResponse, err error)
ListTables : List catalog tables Retrieve a list of the first 100 tables that are defined for the given instance in the catalog.
func (*SqlV2) ListTablesWithContext ¶
func (sql *SqlV2) ListTablesWithContext(ctx context.Context, listTablesOptions *ListTablesOptions) (result *TableList, response *core.DetailedResponse, err error)
ListTablesWithContext is an alternate form of the ListTables method which supports a Context parameter
func (*SqlV2) NewGetSqlJobOptions ¶
func (*SqlV2) NewGetSqlJobOptions(jobID string) *GetSqlJobOptions
NewGetSqlJobOptions : Instantiate GetSqlJobOptions
func (*SqlV2) NewGetTableOptions ¶
func (*SqlV2) NewGetTableOptions(tableName string) *GetTableOptions
NewGetTableOptions : Instantiate GetTableOptions
func (*SqlV2) NewListSqlJobsOptions ¶
func (*SqlV2) NewListSqlJobsOptions() *ListSqlJobsOptions
NewListSqlJobsOptions : Instantiate ListSqlJobsOptions
func (*SqlV2) NewListTablesOptions ¶
func (*SqlV2) NewListTablesOptions() *ListTablesOptions
NewListTablesOptions : Instantiate ListTablesOptions
func (*SqlV2) NewSubmitSqlJobOptions ¶
func (*SqlV2) NewSubmitSqlJobOptions(statement string) *SubmitSqlJobOptions
NewSubmitSqlJobOptions : Instantiate SubmitSqlJobOptions
func (*SqlV2) SetDefaultHeaders ¶
SetDefaultHeaders sets HTTP headers to be sent in every request
func (*SqlV2) SetEnableGzipCompression ¶
SetEnableGzipCompression sets the service's EnableGzipCompression field
func (*SqlV2) SetServiceURL ¶
SetServiceURL sets the service URL
func (*SqlV2) SubmitSqlJob ¶
func (sql *SqlV2) SubmitSqlJob(submitSqlJobOptions *SubmitSqlJobOptions) (result *SqlJobInfoShort, response *core.DetailedResponse, err error)
SubmitSqlJob : Run an SQL job Runs an SQL job using the *IBM Cloud SQL Query* service and stores the result in a new CSV data set in *IBM Cloud Object Storage*. The `FROM` clause references rectangular data that is stored in a Parquet, CSV, or JSON file in *IBM Cloud Object Storage*. Click <a href="https://console.bluemix.net/docs/services/sql-query/sql-query.html#overview">here</a> for more information.
func (*SqlV2) SubmitSqlJobWithContext ¶
func (sql *SqlV2) SubmitSqlJobWithContext(ctx context.Context, submitSqlJobOptions *SubmitSqlJobOptions) (result *SqlJobInfoShort, response *core.DetailedResponse, err error)
SubmitSqlJobWithContext is an alternate form of the SubmitSqlJob method which supports a Context parameter
type SqlV2Options ¶
type SqlV2Options struct { ServiceName string URL string Authenticator core.Authenticator // The cloud resource name (CRN) of the SQL query service instance. InstanceCrn *string `validate:"required"` }
SqlV2Options : Service options
type SubmitSqlJobOptions ¶
type SubmitSqlJobOptions struct { // This is the SQL query to be submitted. The table names specified in its FROM clause must correspond to files in one // or more *IBM Cloud Object Storage* instances. The INTO clause of the query indicates the endpoint, bucket, and // (optionally) subfolder in *IBM Cloud Object Storage* in which the query result is to be stored. Within the specified // target, each result is stored in a separate subfolder with a name that indicates the job ID. The job ID of a query // is returned by the GET endpoint. Statement *string `validate:"required"` // This field provides an alternative way to specify the target URI for a query. It is supported to preserve backward // compatibility and will be removed in a future API version. Use the INTO clause of the SQL query to specify the // target URI instead. ResultsetTarget *string // Allows users to set headers on API requests Headers map[string]string }
SubmitSqlJobOptions : The SubmitSqlJob options.
func (*SubmitSqlJobOptions) SetHeaders ¶
func (options *SubmitSqlJobOptions) SetHeaders(param map[string]string) *SubmitSqlJobOptions
SetHeaders : Allow user to set Headers
func (*SubmitSqlJobOptions) SetResultsetTarget ¶
func (options *SubmitSqlJobOptions) SetResultsetTarget(resultsetTarget string) *SubmitSqlJobOptions
SetResultsetTarget : Allow user to set ResultsetTarget
func (*SubmitSqlJobOptions) SetStatement ¶
func (options *SubmitSqlJobOptions) SetStatement(statement string) *SubmitSqlJobOptions
SetStatement : Allow user to set Statement
type TableInformation ¶
type TableInformation struct { // The name of a catalog table. Name *string `json:"name" validate:"required"` // The type of a catalog table (for example, "TABLE" or "VIEW"). Type *string `json:"type" validate:"required"` // The columns of the table. Columns []ColumnInformation `json:"columns" validate:"required"` }
TableInformation : Detailed information about a catalog table.
type TableList ¶
type TableList struct { // The table names. Tables []string `json:"tables" validate:"required"` // Metadata about the returned tables. TablesMetadata []TableMetadata `json:"tables_metadata" validate:"required"` }
TableList : List of catalog tables.
type TableMetadata ¶
type TableMetadata struct { // The name of a catalog table. Name *string `json:"name" validate:"required"` // The type of a catalog table (for example, "TABLE" or "VIEW"). Type *string `json:"type" validate:"required"` }
TableMetadata : Short metadata about a catalog table.