Documentation
¶
Index ¶
- Constants
- func GoquDialectOptions() *sqlgen.SQLDialectOptions
- func GoquExpressions() *base.Expressions
- type Config
- type DB
- func (db *DB) ListSchemas(ctx context.Context, opts ...sqlconnect.Option) ([]sqlconnect.SchemaRef, error)
- func (db *DB) ListTables(ctx context.Context, schema sqlconnect.SchemaRef, opts ...sqlconnect.Option) ([]sqlconnect.RelationRef, error)
- func (db *DB) SchemaExists(ctx context.Context, schemaRef sqlconnect.SchemaRef, opts ...sqlconnect.Option) (bool, error)
Constants ¶
View Source
const (
DatabaseType = "snowflake"
)
Variables ¶
This section is empty.
Functions ¶
func GoquDialectOptions ¶ added in v1.10.0
func GoquDialectOptions() *sqlgen.SQLDialectOptions
func GoquExpressions ¶ added in v1.10.0
func GoquExpressions() *base.Expressions
Types ¶
type Config ¶
type Config struct {
Account string `json:"account"`
Warehouse string `json:"warehouse"`
DBName string `json:"dbname"`
User string `json:"user"`
Schema string `json:"schema"`
Role string `json:"role"`
Region string `json:"region"`
Protocol string `json:"protocol"` // http or https (optional)
Host string `json:"host"` // hostname (optional)
Port int `json:"port"` // port (optional)
Password string `json:"password"`
UseKeyPairAuth bool `json:"useKeyPairAuth"`
PrivateKey string `json:"privateKey"`
PrivateKeyPassphrase string `json:"privateKeyPassphrase"`
UseOAuth bool `json:"useOAuth"`
OAuthToken string `json:"oauthToken"`
Application string `json:"application"`
LoginTimeout time.Duration `json:"loginTimeout"` // default: 5m
KeepSessionAlive bool `json:"keepSessionAlive"`
UseLegacyMappings bool `json:"useLegacyMappings"`
QueryTag string `json:"queryTag"`
EnableMFACaching bool `json:"enableMFACaching"`
Passcode string `json:"passcode"`
PasscodeInPassword bool `json:"passcodeInPassword"`
}
func (Config) ConnectionString ¶
func (*Config) ParsePrivateKey ¶ added in v1.4.0
func (c *Config) ParsePrivateKey() (*rsa.PrivateKey, error)
type DB ¶
func NewDB ¶
func NewDB(configJSON json.RawMessage) (*DB, error)
NewDB creates a new snowflake db client
func (*DB) ListSchemas ¶ added in v1.25.0
func (db *DB) ListSchemas(ctx context.Context, opts ...sqlconnect.Option) ([]sqlconnect.SchemaRef, error)
ListSchemas overrides the base implementation to handle nonexistent catalog gracefully
func (*DB) ListTables ¶ added in v1.25.0
func (db *DB) ListTables(ctx context.Context, schema sqlconnect.SchemaRef, opts ...sqlconnect.Option) ([]sqlconnect.RelationRef, error)
ListTables overrides the base implementation to handle nonexistent catalog gracefully
func (*DB) SchemaExists ¶ added in v1.25.0
func (db *DB) SchemaExists(ctx context.Context, schemaRef sqlconnect.SchemaRef, opts ...sqlconnect.Option) (bool, error)
SchemaExists overrides the base implementation to handle nonexistent catalog gracefully
Click to show internal directories.
Click to hide internal directories.