Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Close(_ context.Context)
- func (c *Client) GetColumnTypes(ctx context.Context, table string) (map[string]string, error)
- func (c *Client) GetEngineStatus(ctx context.Context) (string, error)
- func (c *Client) GetPrimaryKeys(ctx context.Context, table string) ([]string, error)
- func (c *Client) GetRows(ctx context.Context, table string, orderingColumns, columns []string, ...) ([]map[string]any, error)
- func (c *Client) InsertRow(ctx context.Context, table string, columns []string, values []any) error
- func (c *Client) Login(ctx context.Context, params LoginParams) error
- func (c *Client) RefreshToken(ctx context.Context) error
- func (c *Client) RunQuery(ctx context.Context, query string) (*RunQueryResponse, error)
- func (c *Client) StartEngine(ctx context.Context) (bool, error)
- func (c *Client) WaitEngineStarted(ctx context.Context) error
- type LoginParams
- type RunQueryResponse
- type RunQueryResponseMeta
- type RunQueryResponseStatistics
Constants ¶
const ( // EngineStartedStatus represents a status of a running engine. EngineStartedStatus = "ENGINE_STATUS_RUNNING_REVISION_SERVING" // EngineTerminationSuccessfulStatus represents a status of a succesfully terminated engine. EngineTerminationSuccessfulStatus = "ENGINE_STATUS_TERMINATION_FINISHED" // EngineTerminationdFailedStatus represents a status of a unsuccesfully terminated engine. EngineTerminationdFailedStatus = "ENGINE_STATUS_TERMINATION_FAILED" // MetaTypeUInt8 represents an internal Firebolt's type used for boolean. MetaTypeUInt8 = "UInt8" // MetaTypeDATE represents Firebolt's type used for date. MetaTypeDATE = "Date" // MetaTypeNullableDATE represents Firebolt's type used for date with NULL constraint. MetaTypeNullableDATE = "Nullable(Date)" // MetaTypeTIMESTAMP represents Firebolt's type used for TIMESTAMP . MetaTypeTIMESTAMP = "DateTime" // MetaTypeNullableTIMESTAMP represents Firebolt's type used for TIMESTAMP with NULL constraint. MetaTypeNullableTIMESTAMP = "Nullable(DateTime)" )
Variables ¶
var ( // ErrColumnsValuesLenMismatch occurs when trying to insert a row with a different column and value lengths. ErrColumnsValuesLenMismatch = errors.New("number of columns must be equal to number of values") // ErrCannotCastValueToFloat64 occurs when trying to cast any to float64 but it failed. ErrCannotCastValueToFloat64 = errors.New("cannot cast value to float64") // ErrCannotCastValueToString occurs when trying to cast any to string but it failed. ErrCannotCastValueToString = errors.New("cannot cast value to string") // ErrCannotParseTime occurs when trying to cast any to string but it failed. ErrCannotParseTime = errors.New("parse time error") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for calls to firebolt.
func (*Client) GetColumnTypes ¶
GetColumnTypes get types columns.
func (*Client) GetEngineStatus ¶
GetEngineStatus returns the current status of the underlying engine.
func (*Client) GetPrimaryKeys ¶
GetPrimaryKeys returns the names of primary indexes columns.
func (*Client) GetRows ¶
func (c *Client) GetRows( ctx context.Context, table string, orderingColumns, columns []string, limit, offset int, ) ([]map[string]any, error)
GetRows get rows from table.
func (*Client) InsertRow ¶
InsertRow inserts a row into a table, with the provided columns and values.
func (*Client) Login ¶
func (c *Client) Login(ctx context.Context, params LoginParams) error
Login logins to firebolt.
func (*Client) RefreshToken ¶
RefreshToken performs a refresh token request. The method set the *Client.accessToken field to the new access token.
func (*Client) StartEngine ¶
StartEngine starts a Firebolt engine and returns a bool indicating whether the engine is started or not.
type LoginParams ¶
LoginParams is an incoming params for the Login method.
type RunQueryResponse ¶
type RunQueryResponse struct { Meta []RunQueryResponseMeta `json:"meta"` Data []map[string]any `json:"data"` Rows int `json:"rows"` Statistics RunQueryResponseStatistics `json:"statistics"` }
RunQueryResponse is a response model for run query request.
type RunQueryResponseMeta ¶
RunQueryResponseMeta is a metadata used within the RunQueryResponse.
type RunQueryResponseStatistics ¶
type RunQueryResponseStatistics struct { Elapsed float64 `json:"elapsed"` RowsRead int `json:"rows_read"` BytesRead int `json:"bytes_read"` }
RunQueryResponseStatistics is a statistics used within the RunQueryResponse.