Versions in this module Expand all Collapse all v0 v0.6.3 Aug 26, 2026 v0.6.2 Aug 23, 2026 Changes in this version + var ErrAppendRowInvalid = errors.New("append row must encode to a JSON object") + var ErrAppendRowTooLarge = errors.New("append row exceeds the protocol limit") + var ErrAppendStreamClosed = errors.New("append stream is closed") + var ErrAppendStreamFull = errors.New("append stream buffer is full") + type AppendDeliveryOutcome uint8 + const AppendDeliveryFailed + const AppendDeliveryOK + const AppendDeliveryPartial + const AppendDeliveryUnknown + func (o AppendDeliveryOutcome) String() string + type AppendDeliveryReport struct + AcceptedRows uint64 + CommittedBatches uint64 + CommittedRows uint64 + DroppedRows uint64 + Duration time.Duration + FailedBatches uint64 + FailedRows uint64 + Outcome AppendDeliveryOutcome + Retries uint64 + UnknownBatches uint64 + UnknownRows uint64 + type AppendDroppedRows struct + BufferFull uint64 + Closed uint64 + InvalidRow uint64 + RowTooLarge uint64 + type AppendErrorDetails struct + AppendState AppendState + RowErrors []AppendRowError + RowErrorsTruncated bool + type AppendFailurePolicy uint8 + const AppendFailureContinue + const AppendFailureStop + func (p AppendFailurePolicy) String() string + type AppendLastFailure struct + AppendState AppendState + At time.Time + HTTPStatus int + Message string + RequestID string + RetryAfter time.Duration + Retryable bool + RowErrors []AppendRowError + RowErrorsTruncated bool + type AppendRowError struct + Column string + Message string + RowIndex uint64 + type AppendRowsResult struct + AppendState AppendState + NumRowsInserted int64 + type AppendState string + const AppendStateCommitted + const AppendStateRejected + const AppendStateUnknown + type AppendStream struct + func (s *AppendStream) Flush(ctx context.Context) (AppendDeliveryReport, error) + func (s *AppendStream) Send(ctx context.Context, row any) error + func (s *AppendStream) Shutdown(ctx context.Context) (AppendDeliveryReport, error) + func (s *AppendStream) Stats() AppendStreamStats + func (s *AppendStream) TrySend(row any) error + type AppendStreamOptions struct + AttemptTimeout time.Duration + FailurePolicy AppendFailurePolicy + FlushInterval time.Duration + MaxBatchRows int + MaxBufferedBytes int + MaxConcurrentBatches int + TargetBatchBytes int + type AppendStreamState uint8 + const AppendStreamClosed + const AppendStreamClosing + const AppendStreamFailed + const AppendStreamOpen + func (s AppendStreamState) String() string + type AppendStreamStats struct + AcceptedRows uint64 + CommittedRows uint64 + DroppedByReason AppendDroppedRows + DroppedRows uint64 + FailedRows uint64 + InFlightBatches int + LastFailure *AppendLastFailure + LastReport *AppendDeliveryReport + PendingBytes int + PendingRows uint64 + Retries uint64 + State AppendStreamState + UnknownRows uint64 + type CatalogListOptions struct + PageSize int + PageToken string + type CatalogPage struct + Items []T + NextPageToken string + type Client struct + func NewClient(config Config) (*Client, error) + func (c *Client) Close() + func (c *Client) FetchDatabase(ctx context.Context, database string) (DatabaseResource, error) + func (c *Client) FetchSchema(ctx context.Context, database string, schema string) (SchemaResource, error) + func (c *Client) FetchTable(ctx context.Context, database string, schema string, table string) (TableResource, error) + func (c *Client) IngestStream(statement string, options IngestStreamOptions) (*IngestStream, error) + func (c *Client) IterateDatabases(ctx context.Context, options CatalogListOptions) iter.Seq2[DatabaseResource, error] + func (c *Client) IterateSchemas(ctx context.Context, database string, options CatalogListOptions) iter.Seq2[SchemaResource, error] + func (c *Client) IterateTables(ctx context.Context, database string, schema string, ...) iter.Seq2[TableResourceSummary, error] + func (c *Client) ListDatabases(ctx context.Context, options CatalogListOptions) (CatalogPage[DatabaseResource], error) + func (c *Client) ListSchemas(ctx context.Context, database string, options CatalogListOptions) (CatalogPage[SchemaResource], error) + func (c *Client) ListTables(ctx context.Context, database string, schema string, ...) (CatalogPage[TableResourceSummary], error) + func (c *Client) Query(ctx context.Context, scopeql string) (*ResultSet, error) + func (c *Client) Statement(stmt string) *Statement + func (c *Client) StatementHandle(id uuid.UUID) *StatementHandle + func (c *Client) Table(tableName string) *Table + type Compression string + const CompressionGzip + const CompressionZstd + type Config struct + APIKey string + Compression Compression + Endpoint string + HTTPClient *http.Client + type DataType string + const AnyDataType + const ArrayDataType + const BinaryDataType + const BooleanDataType + const FloatDataType + const IntDataType + const IntervalDataType + const NullDataType + const ObjectDataType + const StringDataType + const TimestampDataType + const UIntDataType + func (d *DataType) UnmarshalJSON(data []byte) error + type DatabaseResource struct + Comment *string + Name string + type Error struct + AppendDetails *AppendErrorDetails + HTTPStatus int + Kind ErrorKind + Message string + RequestID string + RetryAfter time.Duration + Retryable bool + StatementDetails *StatementErrorDetails + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorKind string + const ErrorKindAppendRowsFailed + const ErrorKindConfigInvalid + const ErrorKindStatementFailed + const ErrorKindUnexpected + type FieldSchema struct + Name string + Type DataType + type IngestResult struct + NumRowsInserted int64 + type IngestStream struct + func (s *IngestStream) Flush(ctx context.Context) (IngestResult, error) + func (s *IngestStream) Send(ctx context.Context, row any) error + func (s *IngestStream) Shutdown(ctx context.Context) (IngestResult, error) + type IngestStreamOptions struct + AttemptTimeout time.Duration + FlushInterval time.Duration + MaxBatchRows int + MaxBufferedBytes int + TargetBatchBytes int + type ResultSet struct + Schema Schema + TotalRows uint64 + func (rs *ResultSet) First() (map[string]Value, bool, error) + func (rs *ResultSet) RawRows() ([][]*string, error) + func (rs *ResultSet) ToObjects() ([]map[string]Value, error) + func (rs *ResultSet) ToValues() ([][]Value, error) + type Schema []*FieldSchema + type SchemaResource struct + Comment *string + Database string + Name string + type Statement struct + ExecTimeout string + ID *uuid.UUID + func (s *Statement) Execute(ctx context.Context) (*ResultSet, error) + func (s *Statement) Submit(ctx context.Context) (*StatementHandle, error) + type StatementCancelResult struct + CreatedAt time.Time + Message string + StatementID uuid.UUID + Status StatementStatus + type StatementErrorCode string + const StatementErrorCodeExecuteError + const StatementErrorCodeExecutionTimeout + const StatementErrorCodeHeartbeatLost + const StatementErrorCodePendingTimeout + const StatementErrorCodePrepareError + const StatementErrorCodeRowLimitExceeded + const StatementErrorCodeScanLimitExceeded + type StatementErrorDetails struct + Code StatementErrorCode + Details json.RawMessage + Message string + type StatementHandle struct + func (h *StatementHandle) Cancel(ctx context.Context) (StatementCancelResult, error) + func (h *StatementHandle) ID() uuid.UUID + func (h *StatementHandle) LastStatus() *StatementStatus + func (h *StatementHandle) Progress() *StatementProgress + func (h *StatementHandle) ResultSet() *ResultSet + func (h *StatementHandle) Status(ctx context.Context) (StatementStatus, error) + func (h *StatementHandle) Wait(ctx context.Context) (*ResultSet, error) + type StatementProgress struct + NanosFromStarted int64 + NanosFromSubmitted int64 + ScannedCompressedBytes int64 + ScannedPartitions int64 + ScannedRows int64 + ScannedStages int64 + ScannedUncompressedBytes int64 + SkippedCompressedBytes int64 + SkippedPartitions int64 + SkippedRows int64 + SkippedUncompressedBytes int64 + TotalCompressedBytes int64 + TotalPartitions int64 + TotalPercentage float64 + TotalRows int64 + TotalStages int64 + TotalUncompressedBytes int64 + type StatementStatus string + const StatementStatusCancelled + const StatementStatusFailed + const StatementStatusFinished + const StatementStatusPending + const StatementStatusRunning + func (s StatementStatus) Finished() bool + func (s StatementStatus) Terminated() bool + type Table struct + Database string + Name string + Schema string + func (t *Table) AppendNDJSON(ctx context.Context, ndjson []byte) (AppendRowsResult, error) + func (t *Table) AppendStream(options AppendStreamOptions) (*AppendStream, error) + func (t *Table) Describe(ctx context.Context) (TableResource, error) + func (t *Table) Drop(ctx context.Context) error + func (t *Table) Identifier() string + type TableColumnSpec struct + Comment *string + DataType DataType + Name string + type TableDistinctSpec struct + By []string + On []string + type TableResource struct + ClusterBy []string + Columns []TableColumnSpec + Comment *string + DataRetentionDays *int32 + Database string + DistinctOn TableDistinctSpec + Name string + PartitionBy []string + Schema string + func (resource TableResource) Spec() TableSpec + type TableResourceSummary struct + Comment *string + Database string + Name string + Schema string + type TableSpec struct + ClusterBy []string + Columns []TableColumnSpec + Comment *string + DataRetentionDays *int32 + DistinctOn TableDistinctSpec + PartitionBy []string + type Value any