Documentation ¶
Index ¶
- Variables
- type Config
- type DBInfo
- type Driver
- func (p *Driver) Assemble() (dbinfo *DBInfo, err error)
- func (p *Driver) Constraints(_ drivers.ColumnFilter) (drivers.DBConstraints, error)
- func (p *Driver) Enums(schema string) ([]Enum, error)
- func (p *Driver) TableColumns(tableName string, colFilter drivers.ColumnFilter) ([]drivers.Column, error)
- func (p *Driver) TableNames(tableFilter drivers.Filter) ([]string, error)
- func (p *Driver) ViewColumns(tableName string, filter drivers.ColumnFilter) ([]drivers.Column, error)
- func (p *Driver) ViewNames(tableFilter drivers.Filter) ([]string, error)
- type Enum
- type Extra
- type Interface
Constants ¶
This section is empty.
Variables ¶
View Source
var Templates embed.FS
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver holds the database connection string and a handle to the database connection.
func (*Driver) Constraints ¶
func (p *Driver) Constraints(_ drivers.ColumnFilter) (drivers.DBConstraints, error)
func (*Driver) TableColumns ¶
func (p *Driver) TableColumns(tableName string, colFilter drivers.ColumnFilter) ([]drivers.Column, error)
TableColumns 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 (*Driver) TableNames ¶
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 (*Driver) ViewColumns ¶
Click to show internal directories.
Click to hide internal directories.