Documentation ¶
Overview ¶
Package database defines functions to be used by the Snowflake exporter for interacting with Snowflake
Index ¶
- type Database
- type Snowflake
- func (s *Snowflake) BatchInsert(ctx context.Context, data []map[string]any, sql string) error
- func (s *Snowflake) Close() error
- func (s *Snowflake) CreateSchema(ctx context.Context, schema string) error
- func (s *Snowflake) CreateTable(ctx context.Context, sql string) error
- func (s *Snowflake) InitDatabaseConn(ctx context.Context, role string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { InitDatabaseConn(ctx context.Context, roles string) error CreateSchema(ctx context.Context, schema string) error CreateTable(ctx context.Context, sql string) error BatchInsert(ctx context.Context, data []map[string]any, sql string) error Close() error }
Database defines functions to use to interact with a database
func CreateSnowflakeDatabase ¶
CreateSnowflakeDatabase calls Open() using driverName and the given dsn and then calls Ping()
type Snowflake ¶
type Snowflake struct {
// contains filtered or unexported fields
}
Snowflake implements the Database type
func (*Snowflake) BatchInsert ¶
BatchInsert creates a new transaction using the given DB to insert the given data
func (*Snowflake) CreateSchema ¶
CreateSchema ensures the given schema exists using the given *sql.DB
func (*Snowflake) CreateTable ¶
CreateTable ensures the given table exists using the given database arguments
Click to show internal directories.
Click to hide internal directories.