topbaseapi

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client calls the public Topbase HTTP API. It deliberately does not have access to source-database credentials: every operation remains subject to the API key owner's Topbase permissions.

func New

func New(rawURL, apiKey string, options ...Option) (*Client, error)

func (*Client) CreateAnalysis

func (c *Client) CreateAnalysis(ctx context.Context, input core.Question) (core.Question, error)

func (*Client) DescribeTable

func (c *Client) DescribeTable(ctx context.Context, databaseID, schema, table string) (TableDescription, error)

func (*Client) GetAnalysis

func (c *Client) GetAnalysis(ctx context.Context, id string) (core.Question, error)

func (*Client) ListAnalyses

func (c *Client) ListAnalyses(ctx context.Context) ([]core.Question, error)

func (*Client) ListCollections

func (c *Client) ListCollections(ctx context.Context) ([]core.Collection, error)

func (*Client) ListDatabases

func (c *Client) ListDatabases(ctx context.Context) ([]core.Database, error)

func (*Client) ListTables

func (c *Client) ListTables(ctx context.Context, databaseID string) ([]TableSummary, error)

func (*Client) Preview

func (*Client) RunAnalysis

func (c *Client) RunAnalysis(ctx context.Context, id string) (appquery.DatasetResult, error)

func (*Client) Status

func (c *Client) Status(ctx context.Context) (DeveloperStatus, error)

type DeveloperStatus

type DeveloperStatus struct {
	Status             string `json:"status"`
	UserID             string `json:"user_id"`
	UserName           string `json:"user_name"`
	MaxQueryRows       int    `json:"max_query_rows"`
	AllowAnalysisWrite bool   `json:"allow_analysis_write"`
}

type Option

type Option func(*Client)

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

func WithMaxRows

func WithMaxRows(limit int) Option

type TableDescription

type TableDescription struct {
	Table      TableSummary         `json:"table"`
	Fields     []core.FieldMeta     `json:"fields"`
	Annotation core.TableAnnotation `json:"annotation"`
}

type TableSummary

type TableSummary struct {
	Schema      string        `json:"schema"`
	Name        string        `json:"name"`
	DisplayName string        `json:"display_name,omitempty"`
	Description string        `json:"description,omitempty"`
	Hidden      bool          `json:"hidden,omitempty"`
	Warehouse   bool          `json:"warehouse,omitempty"`
	Columns     []core.Column `json:"columns,omitempty"`
}

Jump to

Keyboard shortcuts

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