Documentation
¶
Overview ¶
Package bigquery implements warehouse.Source for Google BigQuery (GoogleSQL) with cloud.google.com/go/bigquery.
Queries run as query jobs in the configured project and location with positional ("?") parameters, maximum_bytes_billed (max_bytes_billed) and a server-side job timeout matching the context deadline; a job whose caller goes away is canceled. Credentials come from credentials_file (service account, authorized user, impersonated service account or workload identity federation JSON) or Application Default Credentials.
Result values are converted to JSON-friendly Go values:
INT64 → int64
FLOAT64 → float64 ("NaN"/"Infinity"/"-Infinity" strings)
NUMERIC/BIGNUMERIC → float64 when lossless, else the exact decimal string
BOOL, STRING → bool, string
BYTES → base64 string
TIMESTAMP → RFC 3339 string with nanoseconds, UTC
DATE → "YYYY-MM-DD"
TIME → "HH:MM:SS[.fffffffff]"
DATETIME → "YYYY-MM-DDTHH:MM:SS[.fffffffff]"
JSON → decoded value
GEOGRAPHY → WKT string
INTERVAL → canonical interval string ("Y-M D H:M:S")
RANGE<T> → {"start": T|null, "end": T|null}
STRUCT → object
ARRAY<T> → array
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Logger receives warnings (default slog.Default()).
Logger *slog.Logger
// ClientOptions are appended to the options derived from the source
// configuration (endpoint overrides, HTTP clients, credentials).
ClientOptions []option.ClientOption
}
Options are optional settings.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a warehouse.Source backed by a BigQuery client. It is safe for concurrent use.
func New ¶
func New(ctx context.Context, name string, src config.WarehouseSource, opts Options) (*Source, error)
New creates a BigQuery client billed to src.ProjectID. ctx must stay valid for the lifetime of the source (credentials may be refreshed with it).
func (*Source) Placeholder ¶
Placeholder returns "?" (BigQuery positional parameters).