Documentation ¶
Index ¶
- func Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, err error)
- func SnowflakeBuildQueryString(user, pass, dbname, host string, port int, sslmode string) string
- type SnowflakeDriver
- func (m *SnowflakeDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, err error)
- func (m *SnowflakeDriver) Columns(schema, tableName string, whitelist, blacklist []string) ([]drivers.Column, error)
- func (m *SnowflakeDriver) ForeignKeyInfo(schema, tableName string) ([]drivers.ForeignKey, error)
- func (SnowflakeDriver) Imports() (col importers.Collection, err error)
- func (m *SnowflakeDriver) PrimaryKeyInfo(schema, tableName string) (*drivers.PrimaryKey, error)
- func (m *SnowflakeDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error)
- func (SnowflakeDriver) Templates() (map[string]string, error)
- func (m *SnowflakeDriver) TranslateColumnType(drivers.Column) drivers.Column
- func (m *SnowflakeDriver) TranslateTableColumnType(c drivers.Column, tableName string) drivers.Column
- func (m *SnowflakeDriver) ViewCapabilities(schema, name string) (drivers.ViewCapabilities, error)
- func (m *SnowflakeDriver) ViewColumns(schema, tableName string, whitelist, blacklist []string) ([]drivers.Column, error)
- func (m *SnowflakeDriver) ViewNames(schema string, whitelist, blacklist []string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SnowflakeDriver ¶
type SnowflakeDriver struct {
// contains filtered or unexported fields
}
SnowflakeDriver holds the database connection string and a handle to the database connection.
func (*SnowflakeDriver) Assemble ¶
Assemble all the information we need to provide back to the driver
func (*SnowflakeDriver) Columns ¶
func (m *SnowflakeDriver) Columns(schema, tableName string, whitelist, blacklist []string) ([]drivers.Column, error)
Columns takes a table name and attempts to retrieve the table information from the database information_schema.columns. It retrieves the column names and column types and returns those as a []Column after TranslateColumnType() converts the SQL types to Go types, for example: "varchar" to "string"
func (*SnowflakeDriver) ForeignKeyInfo ¶
func (m *SnowflakeDriver) ForeignKeyInfo(schema, tableName string) ([]drivers.ForeignKey, error)
ForeignKeyInfo retrieves the foreign keys for a given table name.
func (SnowflakeDriver) Imports ¶
func (SnowflakeDriver) Imports() (col importers.Collection, err error)
Imports returns important imports for the driver
func (*SnowflakeDriver) PrimaryKeyInfo ¶
func (m *SnowflakeDriver) PrimaryKeyInfo(schema, tableName string) (*drivers.PrimaryKey, error)
PrimaryKeyInfo looks up the primary key for a table.
func (*SnowflakeDriver) TableNames ¶
func (m *SnowflakeDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error)
TableNames connects to the mysql database and retrieves all table names from the information_schema where the table schema is public.
func (SnowflakeDriver) Templates ¶
func (SnowflakeDriver) Templates() (map[string]string, error)
Templates that should be added/overridden
func (*SnowflakeDriver) TranslateColumnType ¶
func (m *SnowflakeDriver) TranslateColumnType(drivers.Column) drivers.Column
TranslateColumnType converts mysql database types to Go types, for example "varchar" to "string" and "bigint" to "int64". It returns this parsed data as a Column object. Deprecated: for Snowflake enum types to be created properly TranslateTableColumnType method should be used instead.
func (*SnowflakeDriver) TranslateTableColumnType ¶
func (m *SnowflakeDriver) TranslateTableColumnType(c drivers.Column, tableName string) drivers.Column
TranslateTableColumnType converts mysql database types to Go types, for example "varchar" to "string" and "bigint" to "int64". It returns this parsed data as a Column object.
func (*SnowflakeDriver) ViewCapabilities ¶
func (m *SnowflakeDriver) ViewCapabilities(schema, name string) (drivers.ViewCapabilities, error)
ViewCapabilities return what actions are allowed for a view.
func (*SnowflakeDriver) ViewColumns ¶
func (*SnowflakeDriver) ViewNames ¶
func (m *SnowflakeDriver) ViewNames(schema string, whitelist, blacklist []string) ([]string, error)
ViewNames connects to the postgres database and retrieves all view names from the information_schema where the view schema is schema. It uses a whitelist and blacklist.