Documentation ¶
Index ¶
- type Column
- type ColumnsProvider
- type ColumnsReader
- type Constraint
- type ConstraintsProvider
- type ConstraintsReader
- type Index
- type IndexColumn
- type IndexColumnsProvider
- type IndexColumnsReader
- type IndexesProvider
- type IndexesReader
- type InformationSchema
- type RecordsCountProvider
- type Scanner
- type SchemaProvider
- type TablePropsReader
- type TableRef
- type TablesProvider
- type TablesReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnsProvider ¶
type ColumnsProvider interface {
GetColumns(c context.Context, db *sql.DB, catalog, schemaName, tableName string) (ColumnsReader, error)
}
ColumnsProvider reads columns info
type ColumnsReader ¶
ColumnsReader provides columns
type Constraint ¶
type Constraint struct { TableRef ColumnName string UniqueConstraintCatalog, UniqueConstraintSchema, UniqueConstraintName sql.NullString MatchOption, UpdateRule, DeleteRule sql.NullString RefTableCatalog, RefTableSchema, RefTableName, RefColName sql.NullString *models.Constraint }
Constraint defines a constraint
type ConstraintsProvider ¶
type ConstraintsProvider interface { // GetConstraints returns constrains GetConstraints(c context.Context, db *sql.DB, catalog, schema, table string) (ConstraintsReader, error) }
ConstraintsProvider provides constraints
type ConstraintsReader ¶
type ConstraintsReader interface {
NextConstraint() (*Constraint, error)
}
ConstraintsReader reads constraint
type IndexColumn ¶
type IndexColumn struct { TableRef IndexName string *models.IndexColumn }
IndexColumn defines index column
type IndexColumnsProvider ¶
type IndexColumnsProvider interface { // GetIndexColumns returns index columns GetIndexColumns(c context.Context, db *sql.DB, catalog, schema, table, index string) (IndexColumnsReader, error) }
IndexColumnsProvider provides index columns
type IndexColumnsReader ¶
type IndexColumnsReader interface { // NextIndexColumn returns index column NextIndexColumn() (*IndexColumn, error) }
IndexColumnsReader provides index columns
type IndexesProvider ¶
type IndexesProvider interface { // GetIndexes returns next index GetIndexes(c context.Context, db *sql.DB, catalog, schema, table string) (IndexesReader, error) }
IndexesProvider provides indexes
type IndexesReader ¶
IndexesReader provides indexes
type InformationSchema ¶
type InformationSchema struct {
// contains filtered or unexported fields
}
InformationSchema provides API to retrieve information about a database
func NewInformationSchema ¶
func NewInformationSchema(server models.ServerReference, db *sql.DB) InformationSchema
NewInformationSchema creates new InformationSchema
func (InformationSchema) GetDatabase ¶
func (s InformationSchema) GetDatabase(name string) (database *models.DbCatalog, err error)
GetDatabase returns complete information about a database
type RecordsCountProvider ¶
type RecordsCountProvider interface {
RecordsCount(c context.Context, db *sql.DB, catalog, schema, table string) (*int, error)
}
RecordsCountProvider provides count for a recordset
type Scanner ¶
type Scanner interface {
ScanCatalog(c context.Context, db *sql.DB, name string) (database *models.DbCatalog, err error)
}
Scanner defines scanner
func NewScanner ¶
func NewScanner(schemaProvider SchemaProvider) Scanner
NewScanner creates new scanner
type SchemaProvider ¶
type SchemaProvider interface { IsBulkProvider() bool TablesProvider ColumnsProvider IndexesProvider IndexColumnsProvider ConstraintsProvider RecordsCountProvider }
SchemaProvider provides schema info
type TablePropsReader ¶
TablePropsReader reads table props
type TablesProvider ¶
type TablesProvider interface { // GetTables returns tables GetTables(c context.Context, db *sql.DB, catalog, schema string) (TablesReader, error) }
TablesProvider provides tables
type TablesReader ¶
TablesReader reads table info