Documentation
¶
Index ¶
- func RegisterExportURIWriter(scheme string, w ExportURIWriter)
- func TimeFromTimestampValue(v string) (time.Time, error)
- type ChangedCatalog
- type ChangedFunction
- type ChangedTable
- type ColumnSpec
- type ColumnType
- type Conn
- func (c *Conn) Begin() (t driver.Tx, e error)
- func (c *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (t driver.Tx, e error)
- func (s *Conn) CheckNamedValue(value *driver.NamedValue) error
- func (c *Conn) Close() error
- func (c *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Result, e error)
- func (c *Conn) IsValid() bool
- func (c *Conn) Prepare(query string) (driver.Stmt, error)
- func (c *Conn) PrepareContext(ctx context.Context, query string) (s driver.Stmt, e error)
- func (c *Conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Rows, e error)
- func (c *Conn) SetMaxNamePath(num int)
- func (c *Conn) SetNamePath(path []string) error
- type Driver
- type ExportURIWriter
- type ExportWriterOpts
- type FunctionSpec
- type NameWithType
- type TableSpec
- type Tx
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterExportURIWriter ¶ added in v0.2.3
func RegisterExportURIWriter(scheme string, w ExportURIWriter)
RegisterExportURIWriter installs w as the writer for EXPORT DATA URIs whose scheme matches scheme (case-insensitive). The "gs" scheme is registered by default and writes to Google Cloud Storage (honoring STORAGE_EMULATOR_HOST so a fake-gcs-server instance is reachable without any extra wiring). Register additional schemes — typically "s3" or "azure" for BigQuery Omni destinations — when the application targets them; an EXPORT DATA against an unregistered scheme fails with a descriptive error rather than silently dropping the export.
Passing a nil writer unregisters the scheme. Registering an already-registered scheme replaces the previous writer; this is by design so an application can swap out the built-in.
func TimeFromTimestampValue ¶
TimeFromTimestampValue converts a googlesqlite TIMESTAMP cell value back to time.Time. The driver's canonical scan form for TIMESTAMP is "YYYY-MM-DD HH:MM:SS[.ffffff]+00" — those land in the canonical branch below. The function also accepts the predecessor's "<unix-secs>[.frac]" epoch-float spelling so callers carrying old testdata or external integrations relying on that shape keep working.
Types ¶
type ChangedCatalog ¶
type ChangedCatalog = internal.ChangedCatalog
func ChangedCatalogFromRows ¶
func ChangedCatalogFromRows(rows *sql.Rows) (*ChangedCatalog, error)
ChangedCatalogFromRows retrieve modified catalog information from sql.Rows. NOTE: This API relies on the internal structure of sql.Rows, so not will work for all Go versions.
type ChangedFunction ¶
type ChangedFunction = internal.ChangedFunction
type ChangedTable ¶
type ChangedTable = internal.ChangedTable
type ColumnSpec ¶
type ColumnSpec = internal.ColumnSpec
type ColumnType ¶
func UnmarshalDatabaseTypeName ¶
func UnmarshalDatabaseTypeName(typ string) (*ColumnType, error)
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) CheckNamedValue ¶
func (s *Conn) CheckNamedValue(value *driver.NamedValue) error
func (*Conn) ExecContext ¶
func (*Conn) IsValid ¶ added in v0.3.0
IsValid implements database/sql/driver.Validator. database/sql calls it on every pool fetch before handing the Conn to the next caller — returning false makes the pool discard us and pull a fresh one instead of letting us surface a confusing "sql: connection is already closed" error inside the next request. The flag is set by translateConnDone whenever an earlier operation observed the inner handle had been closed (typically by a request whose context was cancelled mid-statement; database/sql's tx watcher then ran Rollback(discardConn=true) on the inner connection).
func (*Conn) PrepareContext ¶
func (*Conn) QueryContext ¶
func (*Conn) SetMaxNamePath ¶
SetMaxNamePath specifies the maximum value of name path. If the name path in the query is the maximum value, the name path set as prefix is not used. Effective only when a value greater than zero is specified ( default zero ).
func (*Conn) SetNamePath ¶
SetNamePath set path to name path to be set as prefix. If max name path is specified, an error is returned if the number is exceeded.
type ExportURIWriter ¶ added in v0.2.3
type ExportURIWriter = exportdata.URIWriter
ExportURIWriter opens an io.WriteCloser for an EXPORT DATA destination URI. The engine uses it to materialize the rows produced by an `EXPORT DATA OPTIONS(uri = '...', format = '...', ...) AS <query>` statement. See RegisterExportURIWriter.
type ExportWriterOpts ¶ added in v0.2.3
type ExportWriterOpts = exportdata.WriterOpts
ExportWriterOpts carries the EXPORT DATA OPTIONS that influence how the destination is opened. Implementations of ExportURIWriter should honor each field where it is meaningful to their scheme and ignore the rest.
type FunctionSpec ¶
type FunctionSpec = internal.FunctionSpec
type NameWithType ¶
type NameWithType = internal.NameWithType
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
googlesqlite
command
Command googlesqlite is an interactive console for running GoogleSQL queries against the SQLite-backed googlesqlite engine, in the spirit of the sqlite3 and spanner-cli REPLs.
|
Command googlesqlite is an interactive console for running GoogleSQL queries against the SQLite-backed googlesqlite engine, in the spirit of the sqlite3 and spanner-cli REPLs. |
|
specctl
command
Command specctl is the operational CLI for the spec → test pipeline.
|
Command specctl is the operational CLI for the spec → test pipeline. |
|
specctl/compliancetest
Package compliancetest parses the GoogleSQL compliance "*.test" fixture format.
|
Package compliancetest parses the GoogleSQL compliance "*.test" fixture format. |
|
Small Go-side helpers built on top of go-googlesql.
|
Small Go-side helpers built on top of go-googlesql. |
|
cli
Package cli is the shared core of the googlesqlite command-line tool.
|
Package cli is the shared core of the googlesqlite command-line tool. |
|
exportdata
Package exportdata holds the EXPORT DATA execution machinery: the URI writer registry, built-in writers (gs://), the format encoders and the compression wrappers the driver uses to materialize an `EXPORT DATA OPTIONS(...) AS SELECT ...` statement to its destination.
|
Package exportdata holds the EXPORT DATA execution machinery: the URI writer registry, built-in writers (gs://), the format encoders and the compression wrappers the driver uses to materialize an `EXPORT DATA OPTIONS(...) AS SELECT ...` statement to its destination. |
|
functions/aead
Package aead implements the BigQuery AEAD encryption functions (AEAD.ENCRYPT, AEAD.DECRYPT_*, DETERMINISTIC_ENCRYPT, KEYS.*).
|
Package aead implements the BigQuery AEAD encryption functions (AEAD.ENCRYPT, AEAD.DECRYPT_*, DETERMINISTIC_ENCRYPT, KEYS.*). |
|
functions/extras
Package extras backs the BigQuery / Spanner extension functions that have no upstream signature ID in the GoogleSQL builtin catalog:
|
Package extras backs the BigQuery / Spanner extension functions that have no upstream signature ID in the GoogleSQL builtin catalog: |
|
functions/geography
Package geography uses golang/geo/s2 for spherical geometry computations.
|
Package geography uses golang/geo/s2 for spherical geometry computations. |
|
functions/helper
Package aggrt holds the aggregator-runtime types and helpers shared between the internal Aggregator wrapper, the window sub-package, and per-aggregate function implementations.
|
Package aggrt holds the aggregator-runtime types and helpers shared between the internal Aggregator wrapper, the window sub-package, and per-aggregate function implementations. |
|
functions/kll
Package kll implements KLL quantile sketches for the BigQuery `kll_quantiles.*` family.
|
Package kll implements KLL quantile sketches for the BigQuery `kll_quantiles.*` family. |
|
functions/longtail
Package longtail collects the small-footprint runtime functions that don't warrant a dedicated category package.
|
Package longtail collects the small-footprint runtime functions that don't warrant a dedicated category package. |
|
functions/proto
Package proto backs the GoogleSQL proto-reflection runtime surface.
|
Package proto backs the GoogleSQL proto-reflection runtime surface. |
|
functions/rangefn
Package rangefn implements the runtime body for GoogleSQL RANGE functions: the constructor `RANGE(start, end)` and the accessors `RANGE_START`, `RANGE_END`, `RANGE_IS_START_UNBOUNDED`, `RANGE_IS_END_UNBOUNDED`.
|
Package rangefn implements the runtime body for GoogleSQL RANGE functions: the constructor `RANGE(start, end)` and the accessors `RANGE_START`, `RANGE_END`, `RANGE_IS_START_UNBOUNDED`, `RANGE_IS_END_UNBOUNDED`. |
|
functions/spanner
Package spanner contains the per-spec runtime UDFs that back Spanner's `mysql.*` compatibility namespace.
|
Package spanner contains the per-spec runtime UDFs that back Spanner's `mysql.*` compatibility namespace. |
|
intervalvalue
Package intervalvalue is a vendored copy of the IntervalValue type and its helpers from cloud.google.com/go/bigquery.
|
Package intervalvalue is a vendored copy of the IntervalValue type and its helpers from cloud.google.com/go/bigquery. |
|
specmeta
Package specmeta defines the shared frontmatter and on-disk layout used by spec markdown files and their accompanying testdata YAML.
|
Package specmeta defines the shared frontmatter and on-disk layout used by spec markdown files and their accompanying testdata YAML. |
|
sqlitex
Package sqlitex provides a thin compatibility shim that lets us register Go-typed scalar, aggregate, and window functions on an ncruces/go-sqlite3 connection using the same shapes that the predecessor exposed through its SQLite binding.
|
Package sqlitex provides a thin compatibility shim that lets us register Go-typed scalar, aggregate, and window functions on an ncruces/go-sqlite3 connection using the same shapes that the predecessor exposed through its SQLite binding. |