Documentation
¶
Index ¶
- func ExampleRowsNext()
- func NewConnector(cfg *Config) (driver.Connector, error)
- func SetOptions(opts ...option.ClientOption)
- type Config
- type Driver
- type NamedValues
- type OAuth2Manager
- func (o *OAuth2Manager) ConfigFromURL(ctx context.Context, URL string) (*oauth2.Config, error)
- func (o *OAuth2Manager) Token(ctx context.Context, config *oauth2.Config, scopes ...string) (*oauth2.Token, error)
- func (o *OAuth2Manager) TokenFromURL(ctx context.Context, URL string) (*auth.Token, error)
- func (o *OAuth2Manager) TokenSource(ctx context.Context, cfg *oauth2.Config, token *auth.Token) (oauth2.TokenSource, error)
- func (o *OAuth2Manager) WithConfigURL(ctx context.Context, config *oauth2.Config) (string, error)
- func (o *OAuth2Manager) WithTokenURL(ctx context.Context, token *oauth2.Token) (string, error)
- type OAuth2Option
- type Rows
- type Statement
- func (s *Statement) CheckNamedValue(n *driver.NamedValue) error
- func (s *Statement) Close() error
- func (s *Statement) Exec(args []driver.Value) (driver.Result, error)
- func (s *Statement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (s *Statement) NumInput() int
- func (s *Statement) Query(args []driver.Value) (driver.Rows, error)
- func (s *Statement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnector ¶
NewConnector returns new driver.Connector.
func SetOptions ¶
func SetOptions(opts ...option.ClientOption)
SetOptions sets global client options
Types ¶
type Config ¶
type Config struct { CredentialsFile string // Username Endpoint string APIKey string CredentialJSON []byte CredentialsURL string CredID string //scy secret resource ID CredentialsKey string UserAgent string ProjectID string // project ID DatasetID string QuotaProject string Scopes []string Location string App string OAuth2ConfigURL string OAuth2TokenURL string url.Values }
Config is a configuration parsed from a DSN string. If a new Config is created instead of being parsed from a DSN string, the NewConfig function should be used, which sets default values.
type Driver ¶
type Driver struct{}
Driver is exported to make the driver directly accessible. In general the driver is used via the database/sql package.
func (Driver) Open ¶
Open new Connection. See https://github.com/viant/bigquery#dsn-data-source-name for how the DSN string is formatted
func (Driver) OpenConnector ¶
OpenConnector implements driver.DriverContext.
func (*Driver) SetGCPClientOptions ¶
func (d *Driver) SetGCPClientOptions(options ...option.ClientOption)
SetGCPClientOptions sets global gcp options
type NamedValues ¶
type NamedValues []driver.NamedValue
NamedValues represents name values slice
func (NamedValues) QueryParameter ¶
func (v NamedValues) QueryParameter() ([]*bigquery.QueryParameter, error)
QueryParameter converts value to query parameters
type OAuth2Manager ¶ added in v0.5.0
type OAuth2Manager struct {
// contains filtered or unexported fields
}
OAuth2Manager represents oauth2 manager
func NewOAuth2Manager ¶ added in v0.5.0
func NewOAuth2Manager(opts ...OAuth2Option) *OAuth2Manager
func (*OAuth2Manager) ConfigFromURL ¶ added in v0.5.0
func (*OAuth2Manager) TokenFromURL ¶ added in v0.5.0
func (*OAuth2Manager) TokenSource ¶ added in v0.5.0
func (o *OAuth2Manager) TokenSource(ctx context.Context, cfg *oauth2.Config, token *auth.Token) (oauth2.TokenSource, error)
TokenSource returns oauth2.TokenSource constructed with provided config and token. The returned source automatically refreshes the supplied token when it expires. An error is returned if either cfg or token is nil.
func (*OAuth2Manager) WithConfigURL ¶ added in v0.5.0
func (*OAuth2Manager) WithTokenURL ¶ added in v0.5.0
type OAuth2Option ¶ added in v0.5.0
type OAuth2Option func(*OAuth2Manager)
func WithNewAuthCodeEndpoint ¶ added in v0.5.1
func WithNewAuthCodeEndpoint(f func() (flow.Endpoint, error)) OAuth2Option
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows abstraction implements database/sql driver.Rows interface
func (*Rows) ColumnTypeDatabaseTypeName ¶
ColumnTypeDatabaseTypeName returns column database type name
func (*Rows) ColumnTypeNullable ¶
ColumnTypeNullable returns if column is nullable
func (*Rows) ColumnTypeScanType ¶
ColumnTypeScanType returns column scan type
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement abstraction implements database/sql driver.Statement interface
func (*Statement) CheckNamedValue ¶
func (s *Statement) CheckNamedValue(n *driver.NamedValue) error
CheckNamedValue checks name values
func (*Statement) ExecContext ¶
func (s *Statement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
ExecContext executes statements
func (*Statement) QueryContext ¶
func (s *Statement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
QueryContext runs query