Documentation ¶
Index ¶
- func Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, err error)
- func MSSQLBuildQueryString(user, pass, dbname, host string, port int, sslmode string) string
- type MSSQLDriver
- func (m *MSSQLDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, err error)
- func (m *MSSQLDriver) Columns(schema, tableName string, whitelist, blacklist []string) ([]drivers.Column, error)
- func (m *MSSQLDriver) ForeignKeyInfo(schema, tableName string) ([]drivers.ForeignKey, error)
- func (MSSQLDriver) Imports() (col importers.Collection, err error)
- func (m *MSSQLDriver) PrimaryKeyInfo(schema, tableName string) (*drivers.PrimaryKey, error)
- func (m *MSSQLDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error)
- func (MSSQLDriver) Templates() (map[string]string, error)
- func (m *MSSQLDriver) TranslateColumnType(c drivers.Column) drivers.Column
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MSSQLDriver ¶
type MSSQLDriver struct {
// contains filtered or unexported fields
}
MSSQLDriver holds the database connection string and a handle to the database connection.
func (*MSSQLDriver) Columns ¶
func (m *MSSQLDriver) 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 (*MSSQLDriver) ForeignKeyInfo ¶
func (m *MSSQLDriver) ForeignKeyInfo(schema, tableName string) ([]drivers.ForeignKey, error)
ForeignKeyInfo retrieves the foreign keys for a given table name.
func (MSSQLDriver) Imports ¶
func (MSSQLDriver) Imports() (col importers.Collection, err error)
Imports returns important imports for the driver
func (*MSSQLDriver) PrimaryKeyInfo ¶
func (m *MSSQLDriver) PrimaryKeyInfo(schema, tableName string) (*drivers.PrimaryKey, error)
PrimaryKeyInfo looks up the primary key for a table.
func (*MSSQLDriver) TableNames ¶
func (m *MSSQLDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error)
TableNames connects to the postgres database and retrieves all table names from the information_schema where the table schema is schema. It uses a whitelist and blacklist.
func (MSSQLDriver) Templates ¶
func (MSSQLDriver) Templates() (map[string]string, error)
Templates that should be added/overridden
func (*MSSQLDriver) TranslateColumnType ¶
func (m *MSSQLDriver) TranslateColumnType(c drivers.Column) drivers.Column
TranslateColumnType converts postgres database types to Go types, for example "varchar" to "string" and "bigint" to "int64". It returns this parsed data as a Column object.