gcpbigquery

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 47 Imported by: ? 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.

README

BigQuery

Parity grade: B · SDK cloud.google.com/go/bigquery@v1.85.0 · last audited 2026-10-19 (15ea1e35b)

Coverage

Metric Value
PARITY entries audited 28 (28 ok)
Feature families 18 (15 ok, 3 partial)
Known gaps 8
Deferred items 0
Resource leaks clean
Known gaps
  • Not served: models, table and dataset IAM policies (including row access policy IAM), datasets undelete, snapshots/clones as storage objects, BigLake tables and connections, data transfers, analytics hub, reservation groups, reservation failover and reservation IAM, and the Storage Read/Write gRPC APIs.
  • Unsupported GoogleSQL: CAST ... FORMAT between numeric or BYTES types and STRING (date and time types are supported, with AT TIME ZONE), EXPORT DATA, JavaScript, Python and remote UDFs and CREATE AGGREGATE FUNCTION, wildcard tables (_TABLE_SUFFIX), partition pseudo columns (_PARTITIONTIME and _PARTITIONDATE need a per-row ingestion time that rows do not carry; DML rewrites whole row slices in jobs_query.go effectWrite), selecting a whole row as a STRUCT, legacy SQL.
  • Unsupported functions: RANGE values, ML., GEOGRAPHY beyond the implemented ST_ set (use_spheroid => TRUE, make_valid => TRUE, ST_UNION, ST_BUFFER and the other constructors and aggregates), SEARCH over a table reference or a tuple, JSON constructors and mutators beyond JSON_VALUE/JSON_QUERY/PARSE_JSON/TO_JSON_STRING, FORMAT patterns beyond %s %d %i %f %g %e %t %T %x %o, collation.
  • ST_MAKELINE does not snap sufficiently short edges together (geography_functions ST_MAKELINE constraints; snap radius not stated there). Overlap detection of edges beyond the first 1024 only collapses repeated identical edges, and detection off the equator and meridians uses a floating-point tolerance, not an exact predicate. The error text for an edge of 180 degrees or more is emulator wording.
  • SEARCH NO_OP_ANALYZER: the page's example SEARCH(R'"foo bar"', R'"foo Bar"', analyzer=>'NO_OP_ANALYZER') is TRUE with the comment 'analysis is case-insensitive', while its 'Foobar' vs 'foobar' example is FALSE; the emulator keeps NO_OP case-sensitive and returns FALSE for the first. SEARCH also reads upper-case AND/OR inside a double-quoted phrase as logical operators (the page's SEARCH(R'foo bar', R'"foo AND (bar OR baz)"') is TRUE, commented as a logical match); the rule for phrases that really contain those words is not documented, so 'Clyde and Bonnie' matches the query "Bonnie AND Clyde".
  • NUMERIC and BIGNUMERIC: a RANGE window frame with an offset over a NUMERIC or BIGNUMERIC ORDER BY key is rejected as unsupported (SQLite applies the offset to the encoded text); Parquet export writes BIGNUMERIC as STRING because pkgs/parquetio caps DECIMAL precision at 38 (the exporting-data page's BIGNUMERIC type mapping was not read); a scalar function that has no decimal implementation, including the string functions (UPPER, LENGTH, SUBSTR, TRIM and the like), runs on the FLOAT64 conversion of a NUMERIC or BIGNUMERIC argument where BigQuery reports no matching signature; STRUCT equality and IN over structs do not coerce an INT64 or FLOAT64 field to NUMERIC; insertAll, load and DML round a value with more fraction digits than the scale half away from zero (NUMERIC scale 9, BIGNUMERIC scale 38) and the streaming and load pages read do not say whether BigQuery rounds or rejects it; a Parquet load without a schema reads DECIMAL columns as STRING (autodetect types by value).
  • Jobs: no slot or priority scheduling, no query cache, anonymous result tables are not created, script expression evaluations are not recorded as EXPRESSION child jobs, and execution holds the backend write lock (jobs_async.go runLocked), so jobs.cancel and jobTimeoutMs stop a job before it executes and a script between statements, not a plain statement in flight.
  • Load: Datastore and Firestore backups, nested CSV and column-name flexibility options are not supported. External tables: GOOGLE_SHEETS, DATASTORE_BACKUP, BIGTABLE and DELTA_LAKE sources and WITH CONNECTION need services the emulator does not have. External tables and CREATE EXTERNAL TABLE read Cloud Storage while the backend lock is held (external.go readExternalRows). The NDJSON TIMESTAMP and CSV float rendering of extract have not been checked against the live service.

More

Documentation

Index

Constants

View Source
const DefaultPort = 9050

DefaultPort is the dedicated listener's default TCP port.

Variables

View Source
var ErrNilAppContext = errors.New("gcpbigquery: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

View Source
var ErrObjectNotFound = errors.New("object not found")

ErrObjectNotFound is returned by an ObjectStore when a bucket or object does not exist.

View Source
var ErrSnapshotNull = errors.New("gcpbigquery: snapshot contains a null dataset")

ErrSnapshotNull is returned when a snapshot holds a null dataset.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Reason  string
	Message string
	Status  int
}

APIError is a REST error with the HTTP status and BigQuery reason it surfaces as.

func (*APIError) Error

func (e *APIError) Error() string

Error implements error.

type ConfigProvider

type ConfigProvider interface {
	GetGCPBigQuerySettings() Settings
}

ConfigProvider extracts BigQuery configuration from the AppContext Config.

type DataOptions

type DataOptions struct {
	PageToken      string
	SelectedFields string
	StartIndex     int
	Max            int
	Int64Timestamp bool
}

DataOptions are the tabledata.list parameters.

type Dataset

type Dataset struct {
	Meta     map[string]any      `json:"meta"`
	Tables   map[string]*Table   `json:"tables"`
	Routines map[string]*Routine `json:"routines,omitempty"`
	Location string              `json:"location"`
	Created  int64               `json:"created"`
	Modified int64               `json:"modified"`
	Hidden   bool                `json:"hidden,omitempty"`
}

Dataset is a BigQuery dataset. Meta holds the writable passthrough fields (labels, access, description, ...).

type Handler

type Handler struct {
	Backend *InMemoryBackend

	Port int
	// contains filtered or unexported fields
}

Handler serves the BigQuery v2 REST API.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a Handler; callers override Port from Settings.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns project[/dataset[.table]] for metrics.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations lists the supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler for all BigQuery requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher never matches: BigQuery runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the dedicated listener, forcing a close if graceful shutdown fails.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the dedicated listener synchronously so a port conflict is returned to the caller.

type InMemoryBackend

type InMemoryBackend struct {

	// Audit records Cloud Audit Logs entries for dataset, table and job changes.
	Audit gcpaudit.Emitter
	// contains filtered or unexported fields
}

InMemoryBackend holds every dataset, table, row and job under one lock.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty backend.

func (*InMemoryBackend) CancelJob

func (b *InMemoryBackend) CancelJob(project, id string) (map[string]any, error)

CancelJob implements jobs.cancel: a PENDING or RUNNING job is asked to stop and finishes with errorResult stopped; a finished job is returned as is.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close cancels every unfinished job and waits for the workers to stop.

func (*InMemoryBackend) CreateAssignment

func (b *InMemoryBackend) CreateAssignment(
	project, location, reservation, id string, body map[string]any,
) (map[string]any, error)

CreateAssignment implements reservations.assignments.create.

func (*InMemoryBackend) CreateCapacityCommitment

func (b *InMemoryBackend) CreateCapacityCommitment(
	project, location, id string, body map[string]any,
) (map[string]any, error)

CreateCapacityCommitment implements capacityCommitments.create.

func (*InMemoryBackend) CreateDataset

func (b *InMemoryBackend) CreateDataset(project string, body map[string]any) (map[string]any, error)

CreateDataset implements datasets.insert.

func (*InMemoryBackend) CreateReservation

func (b *InMemoryBackend) CreateReservation(
	project, location, id string, body map[string]any,
) (map[string]any, error)

CreateReservation implements reservations.create.

func (*InMemoryBackend) CreateRoutine

func (b *InMemoryBackend) CreateRoutine(project, ds string, body map[string]any) (map[string]any, error)

CreateRoutine implements routines.insert.

func (*InMemoryBackend) CreateRowPolicy

func (b *InMemoryBackend) CreateRowPolicy(project, ds, table string, body map[string]any) (map[string]any, error)

CreateRowPolicy implements rowAccessPolicies.insert.

func (*InMemoryBackend) CreateTable

func (b *InMemoryBackend) CreateTable(project, ds string, body map[string]any) (map[string]any, error)

CreateTable implements tables.insert.

func (*InMemoryBackend) DeleteAssignment

func (b *InMemoryBackend) DeleteAssignment(project, location, reservation, id string) error

DeleteAssignment implements reservations.assignments.delete.

func (*InMemoryBackend) DeleteCapacityCommitment

func (b *InMemoryBackend) DeleteCapacityCommitment(project, location, id string) error

DeleteCapacityCommitment implements capacityCommitments.delete; it fails before the commitment end time.

func (*InMemoryBackend) DeleteDataset

func (b *InMemoryBackend) DeleteDataset(project, id string, deleteContents bool) error

DeleteDataset implements datasets.delete.

func (*InMemoryBackend) DeleteJob

func (b *InMemoryBackend) DeleteJob(project, id string) error

DeleteJob implements jobs.delete.

func (*InMemoryBackend) DeleteReservation

func (b *InMemoryBackend) DeleteReservation(project, location, id string) error

DeleteReservation implements reservations.delete; a reservation with assignments cannot be deleted.

func (*InMemoryBackend) DeleteRoutine

func (b *InMemoryBackend) DeleteRoutine(project, ds, id string) error

DeleteRoutine implements routines.delete.

func (*InMemoryBackend) DeleteRowPolicies

func (b *InMemoryBackend) DeleteRowPolicies(project, ds, table string, ids []string, force bool) error

DeleteRowPolicies implements rowAccessPolicies.delete and batchDelete. Removing the last policy widens access, so it needs force.

func (*InMemoryBackend) DeleteTable

func (b *InMemoryBackend) DeleteTable(project, ds, id string) error

DeleteTable implements tables.delete.

func (*InMemoryBackend) GetBiReservation

func (b *InMemoryBackend) GetBiReservation(project, location string) map[string]any

GetBiReservation implements getBiReservation.

func (*InMemoryBackend) GetCapacityCommitment

func (b *InMemoryBackend) GetCapacityCommitment(project, location, id string) (map[string]any, error)

GetCapacityCommitment implements capacityCommitments.get.

func (*InMemoryBackend) GetDataset

func (b *InMemoryBackend) GetDataset(project, id string) (map[string]any, error)

GetDataset implements datasets.get.

func (*InMemoryBackend) GetJob

func (b *InMemoryBackend) GetJob(project, id string) (map[string]any, error)

GetJob implements jobs.get.

func (*InMemoryBackend) GetQueryResults

func (b *InMemoryBackend) GetQueryResults(project, id string, o QueryResultOptions) (map[string]any, error)

GetQueryResults implements jobs.getQueryResults; it waits up to timeoutMs (default 10 s) for a job that is not done and then answers jobComplete=false.

func (*InMemoryBackend) GetReservation

func (b *InMemoryBackend) GetReservation(project, location, id string) (map[string]any, error)

GetReservation implements reservations.get.

func (*InMemoryBackend) GetRoutine

func (b *InMemoryBackend) GetRoutine(project, ds, id string) (map[string]any, error)

GetRoutine implements routines.get.

func (*InMemoryBackend) GetRowPolicy

func (b *InMemoryBackend) GetRowPolicy(project, ds, table, id string) (map[string]any, error)

GetRowPolicy implements rowAccessPolicies.get.

func (*InMemoryBackend) GetTable

func (b *InMemoryBackend) GetTable(project, ds, id string) (map[string]any, error)

GetTable implements tables.get.

func (*InMemoryBackend) InsertAll

func (b *InMemoryBackend) InsertAll(project, ds, id string, req InsertRequest) (map[string]any, error)

InsertAll implements tabledata.insertAll.

func (*InMemoryBackend) InsertJob

func (b *InMemoryBackend) InsertJob(
	ctx context.Context,
	project string,
	body map[string]any,
	media []byte,
) (map[string]any, error)

InsertJob implements jobs.insert; media carries the body of a multipart or resumable upload for load jobs.

func (*InMemoryBackend) ListAssignments

func (b *InMemoryBackend) ListAssignments(
	project, location, reservation string, o ListOptions,
) (page.Page[map[string]any], error)

ListAssignments implements reservations.assignments.list; reservation "-" lists every reservation's assignments.

func (*InMemoryBackend) ListCapacityCommitments

func (b *InMemoryBackend) ListCapacityCommitments(project, location string, o ListOptions) page.Page[map[string]any]

ListCapacityCommitments implements capacityCommitments.list.

func (*InMemoryBackend) ListData

func (b *InMemoryBackend) ListData(project, ds, id string, o DataOptions) (map[string]any, error)

ListData implements tabledata.list.

func (*InMemoryBackend) ListDatasets

func (b *InMemoryBackend) ListDatasets(project string, o ListOptions) page.Page[map[string]any]

ListDatasets implements datasets.list.

func (*InMemoryBackend) ListJobs

func (b *InMemoryBackend) ListJobs(project string, o JobListOptions) page.Page[map[string]any]

ListJobs implements jobs.list, newest first.

func (*InMemoryBackend) ListProjects

func (b *InMemoryBackend) ListProjects() []map[string]any

ListProjects implements projects.list over every project that owns a dataset or a job.

func (*InMemoryBackend) ListReservations

func (b *InMemoryBackend) ListReservations(project, location string, o ListOptions) page.Page[map[string]any]

ListReservations implements reservations.list.

func (*InMemoryBackend) ListRoutines

func (b *InMemoryBackend) ListRoutines(
	project, ds string, o ListOptions, readMask string,
) (page.Page[map[string]any], error)

ListRoutines implements routines.list; filter is routineType:{type} and readMask adds fields to the summary.

func (*InMemoryBackend) ListRowPolicies

func (b *InMemoryBackend) ListRowPolicies(
	project, ds, table string, o ListOptions,
) (page.Page[map[string]any], error)

ListRowPolicies implements rowAccessPolicies.list, ordered by policy ID.

func (*InMemoryBackend) ListTables

func (b *InMemoryBackend) ListTables(project, ds string, o ListOptions) (page.Page[map[string]any], error)

ListTables implements tables.list.

func (*InMemoryBackend) MergeCapacityCommitments

func (b *InMemoryBackend) MergeCapacityCommitments(
	project, location string, body map[string]any,
) (map[string]any, error)

MergeCapacityCommitments implements capacityCommitments.merge: commitments of one plan become a single one.

func (*InMemoryBackend) MoveAssignment

func (b *InMemoryBackend) MoveAssignment(
	project, location, reservation, id string, body map[string]any,
) (map[string]any, error)

MoveAssignment implements reservations.assignments.move into another reservation of the same location.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a snapshot.

func (*InMemoryBackend) RunQuery

func (b *InMemoryBackend) RunQuery(ctx context.Context, project string, req map[string]any) (map[string]any, error)

RunQuery implements jobs.query: it creates a query job, runs it and returns the first page of results.

func (*InMemoryBackend) SearchAssignments

func (b *InMemoryBackend) SearchAssignments(
	project, location, query string, o ListOptions,
) (page.Page[map[string]any], error)

SearchAssignments implements searchAssignments and searchAllAssignments; the query is assignee="projects/x".

func (*InMemoryBackend) SetExtractShardBytes

func (b *InMemoryBackend) SetExtractShardBytes(n int64)

SetExtractShardBytes sets the shard size of extract jobs; n <= 0 restores the 1 GiB default.

func (*InMemoryBackend) SetJobStartHook

func (b *InMemoryBackend) SetJobStartHook(fn func(ctx context.Context, phase, project, id string))

SetJobStartHook runs fn on the job's worker in phase PENDING (before) and RUNNING (after the state change); tests use it to hold a job in either state.

func (*InMemoryBackend) SetLoadLimits

func (b *InMemoryBackend) SetLoadLimits(files int, bytes int64)

SetLoadLimits sets the source file count and decompressed byte caps of a load job; zero keeps the default.

func (*InMemoryBackend) SetObjectStore

func (b *InMemoryBackend) SetObjectStore(s ObjectStore)

SetObjectStore wires the object store load and extract jobs read from and write to.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state.

func (*InMemoryBackend) SplitCapacityCommitment

func (b *InMemoryBackend) SplitCapacityCommitment(
	project, location, id string, body map[string]any,
) (map[string]any, error)

SplitCapacityCommitment implements capacityCommitments.split; the pieces keep the plan and end time.

func (*InMemoryBackend) UpdateAssignment

func (b *InMemoryBackend) UpdateAssignment(
	project, location, reservation, id, mask string, body map[string]any,
) (map[string]any, error)

UpdateAssignment implements reservations.assignments.patch; the assignee and job type are fixed.

func (*InMemoryBackend) UpdateBiReservation

func (b *InMemoryBackend) UpdateBiReservation(
	project, location, mask string, body map[string]any,
) (map[string]any, error)

UpdateBiReservation implements updateBiReservation.

func (*InMemoryBackend) UpdateCapacityCommitment

func (b *InMemoryBackend) UpdateCapacityCommitment(
	project, location, id, mask string, body map[string]any,
) (map[string]any, error)

UpdateCapacityCommitment implements capacityCommitments.patch: only plan and renewalPlan change, and the plan can only move to a longer commitment period.

func (*InMemoryBackend) UpdateDataset

func (b *InMemoryBackend) UpdateDataset(project, id string, body map[string]any, replace bool) (map[string]any, error)

UpdateDataset implements datasets.patch (merge) and datasets.update (replace).

func (*InMemoryBackend) UpdateReservation

func (b *InMemoryBackend) UpdateReservation(
	project, location, id, mask string, body map[string]any,
) (map[string]any, error)

UpdateReservation implements reservations.patch.

func (*InMemoryBackend) UpdateRoutine

func (b *InMemoryBackend) UpdateRoutine(
	project, ds, id, ifMatch string, body map[string]any,
) (map[string]any, error)

UpdateRoutine implements routines.update. The Go client sends only the changed fields, so the body merges into the stored routine (a null removes a field); a non-empty ifMatch must equal the current etag.

func (*InMemoryBackend) UpdateRowPolicy

func (b *InMemoryBackend) UpdateRowPolicy(
	project, ds, table, id, ifMatch string, body map[string]any,
) (map[string]any, error)

UpdateRowPolicy implements rowAccessPolicies.update: the filter is replaced and the grantee list only when sent.

func (*InMemoryBackend) UpdateTable

func (b *InMemoryBackend) UpdateTable(
	project, ds, id string,
	body map[string]any,
	replace bool,
) (map[string]any, error)

UpdateTable implements tables.patch (merge) and tables.update (replace).

type InsertRequest

type InsertRequest struct {
	TemplateSuffix      string      `json:"templateSuffix"`
	Rows                []InsertRow `json:"rows"`
	SkipInvalidRows     bool        `json:"skipInvalidRows"`
	IgnoreUnknownValues bool        `json:"ignoreUnknownValues"`
}

InsertRequest is the tabledata.insertAll request body.

type InsertRow

type InsertRow struct {
	JSON     map[string]any `json:"json"`
	InsertID string         `json:"insertId"`
}

InsertRow is one row of a streaming insert.

type Job

type Job struct {
	Config      map[string]any `json:"config"`
	Stats       map[string]any `json:"stats"`
	ErrorResult *jobError      `json:"errorResult,omitempty"`
	Errors      []*jobError    `json:"errors,omitempty"`
	Dest        *tableRef      `json:"dest,omitempty"`
	Project     string         `json:"project"`
	ID          string         `json:"id"`
	Location    string         `json:"location"`
	RequestID   string         `json:"requestId,omitempty"`
	Type        string         `json:"type"`
	State       string         `json:"state"`
	User        string         `json:"user"`
	Schema      []bqsql.Field  `json:"schema,omitempty"`
	Rows        [][]any        `json:"rows,omitempty"`
	Created     int64          `json:"created"`
	Started     int64          `json:"started"`
	Ended       int64          `json:"ended"`
	NumDML      int64          `json:"numDml"`
	DryRun      bool           `json:"dryRun,omitempty"`
	HasResult   bool           `json:"hasResult,omitempty"`
}

Job is a BigQuery job. Query jobs keep their result rows so getQueryResults can page them.

type JobListOptions

type JobListOptions struct {
	PageToken   string
	Parent      string
	StateFilter []string
	MinCreated  int64
	MaxCreated  int64
	Max         int
}

JobListOptions are the jobs.list parameters.

type ListOptions

type ListOptions struct {
	Filter    string
	PageToken string
	Max       int
	All       bool
}

ListOptions carries the paging parameters shared by list calls.

type ObjectStore

type ObjectStore interface {
	// ListObjects returns the names of every object in bucket that starts with prefix.
	ListObjects(bucket, prefix string) ([]string, error)
	// ReadObject returns the content of one object.
	ReadObject(bucket, name string) ([]byte, error)
	// WriteObject creates or replaces one object.
	WriteObject(bucket, name string, data []byte, contentType string) error
}

ObjectStore is the slice of Cloud Storage that load and extract jobs need.

type Provider

type Provider struct{}

Provider implements service.Provider for Google BigQuery. It serves the REST API on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.

func (*Provider) Init

Init creates the backend and handler; the port is bound in StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type QueryResultOptions

type QueryResultOptions struct {
	TimeoutMs      *int
	PageToken      string
	StartIndex     int
	Max            int
	Int64Timestamp bool
}

QueryResultOptions are the getQueryResults parameters.

type Routine

type Routine struct {
	Resource map[string]any `json:"resource"`
	Created  int64          `json:"created"`
	Modified int64          `json:"modified"`
	Seq      int64          `json:"seq"`
}

Routine is a stored function or procedure; Resource holds the writable REST fields.

type RowPolicy

type RowPolicy struct {
	ID       string   `json:"id"`
	Filter   string   `json:"filter"`
	Grantees []string `json:"grantees"`
	Created  int64    `json:"created"`
	Modified int64    `json:"modified"`
	Seq      int64    `json:"seq"`
}

RowPolicy is a row access policy stored on a table.

type Settings

type Settings struct {
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 164-byte string literal not displayed */
}

Settings holds service-level configuration, embedded in the root CLI command as CLI.GCPBigQuery.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider is available.

type StreamBuffer

type StreamBuffer struct {
	Rows     int64 `json:"rows"`
	Bytes    int64 `json:"bytes"`
	OldestMs int64 `json:"oldestMs"`
}

StreamBuffer tracks rows written through tabledata.insertAll that real BigQuery has not yet flushed.

type Table

type Table struct {
	Stream      *StreamBuffer    `json:"stream,omitempty"`
	Meta        map[string]any   `json:"meta"`
	Seen        map[string]int64 `json:"seen,omitempty"`
	ViewQuery   string           `json:"viewQuery,omitempty"`
	MV          map[string]any   `json:"mv,omitempty"`
	Schema      []bqsql.Field    `json:"schema"`
	Rows        [][]any          `json:"rows"`
	History     []TableVersion   `json:"history,omitempty"`
	RowPolicies []*RowPolicy     `json:"rowPolicies,omitempty"`
	Created     int64            `json:"created"`
	Modified    int64            `json:"modified"`
	Seq         int64            `json:"seq"`
}

Table is a table or view with its rows in the canonical stored encoding.

type TableVersion

type TableVersion struct {
	Schema []bqsql.Field `json:"schema"`
	Rows   [][]any       `json:"rows"`
	At     int64         `json:"at"`
}

TableVersion is the state a table had until At (unix milliseconds); it backs FOR SYSTEM_TIME AS OF.

Directories

Path Synopsis
Package bqsql runs a GoogleSQL subset on SQLite and converts BigQuery values between their REST encodings.
Package bqsql runs a GoogleSQL subset on SQLite and converts BigQuery values between their REST encodings.

Jump to

Keyboard shortcuts

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