models

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: MIT Imports: 6 Imported by: 2 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const LimitRows = 32_000

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelResponse

type CancelResponse struct {
	Success bool `json:"success"`
}

func (CancelResponse) HasError

func (r CancelResponse) HasError() error

type ExecuteRequest

type ExecuteRequest struct {
	QueryParameters map[string]any `json:"query_parameters,omitempty"`
}

type ExecuteResponse

type ExecuteResponse struct {
	ExecutionID string `json:"execution_id,omitempty"`
	State       string `json:"state,omitempty"`
}

func (ExecuteResponse) HasError

func (e ExecuteResponse) HasError() error

type Result

type Result struct {
	Metadata ResultMetadata   `json:"metadata,omitempty"`
	Rows     []map[string]any `json:"rows,omitempty"`
}

type ResultMetadata

type ResultMetadata struct {
	ColumnNames         []string `json:"column_names,omitempty"`
	ResultSetBytes      int64    `json:"result_set_bytes,omitempty"`
	RowCount            int      `json:"row_count,omitempty"`
	TotalResultSetBytes int64    `json:"total_result_set_bytes,omitempty"`
	TotalRowCount       int      `json:"total_row_count,omitempty"`
	DatapointCount      int      `json:"datapoint_count,omitempty"`
}

type ResultOptions

type ResultOptions struct {
	// request a specific page of rows
	Page *ResultPageOption
}

ResultOptions is a struct that contains options for getting a result

func (ResultOptions) ToURLValues

func (r ResultOptions) ToURLValues() url.Values

type ResultPageOption

type ResultPageOption struct {
	// we can have more than 2^32 rows, so we need to use int64 for the offset
	Offset uint64
	// assume server can't return more than 2^32 rows
	Limit uint32
}

To paginate a large result set

type ResultsResponse

type ResultsResponse struct {
	QueryID             int64      `json:"query_id"`
	State               string     `json:"state"`
	SubmittedAt         time.Time  `json:"submitted_at"`
	ExpiresAt           time.Time  `json:"expires_at"`
	ExecutionStartedAt  *time.Time `json:"execution_started_at,omitempty"`
	ExecutionEndedAt    *time.Time `json:"execution_ended_at,omitempty"`
	CancelledAt         *time.Time `json:"cancelled_at,omitempty"`
	Error               *any       `json:"error,omitempty"`
	Result              Result     `json:"result,omitempty"`
	NextOffset          *uint64    `json:"next_offset,omitempty"`
	NextURI             *string    `json:"next_uri,omitempty"`
	IsExecutionFinished bool       `json:"is_execution_finished,omitempty"`
}

func (*ResultsResponse) AddPageResult

func (r *ResultsResponse) AddPageResult(pageResp *ResultsResponse)

func (ResultsResponse) HasError

func (r ResultsResponse) HasError() error

func (ResultsResponse) IsEmpty

func (r ResultsResponse) IsEmpty() bool

type StatusResponse

type StatusResponse struct {
	ExecutionID        string          `json:"execution_id,omitempty"`
	QueryID            int             `json:"query_id,omitempty"`
	State              string          `json:"state,omitempty"`
	SubmittedAt        time.Time       `json:"submitted_at,omitempty"`
	ExecutionStartedAt *time.Time      `json:"execution_started_at,omitempty"`
	ExecutionEndedAt   *time.Time      `json:"execution_ended_at,omitempty"`
	CancelledAt        *time.Time      `json:"cancelled_at,omitempty"`
	ResultMetadata     *ResultMetadata `json:"result_metadata,omitempty"`
}

func (StatusResponse) HasError

func (s StatusResponse) HasError() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL