Documentation
¶
Index ¶
- Constants
- func FindTable(tables datatug.Tables, catalog, schema, name string) *datatug.CollectionInfo
- func NewSchemaKey(catalog, schema string) *dal.Key
- type CollectionsProvider
- type CollectionsReader
- 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 RecordsCountProvider
- type Scanner
- type SchemaProvider
- type SortedIndexes
- type SortedTables
- type TableRef
Constants ¶
const ( CatalogsCollection = "catalogs" SchemasCollection = "schemas" )
Variables ¶
This section is empty.
Functions ¶
func FindTable ¶ added in v0.11.0
func FindTable(tables datatug.Tables, catalog, schema, name string) *datatug.CollectionInfo
FullFind can be called in any order and always do a full table scan
func NewSchemaKey ¶ added in v0.11.0
Types ¶
type CollectionsProvider ¶ added in v0.11.0
type CollectionsProvider interface {
// GetCollections returns root collections if parentKey is nil or sub-collection if parenKey is provided
GetCollections(c context.Context, parentKey *dal.Key) (CollectionsReader, error)
}
CollectionsProvider provides Tables
type CollectionsReader ¶ added in v0.11.0
type CollectionsReader interface {
NextCollection() (*datatug.CollectionInfo, error)
}
CollectionsReader reads collection info
type ColumnsProvider ¶
type ColumnsProvider interface {
GetColumns(c context.Context, 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 string // can be null
MatchOption, UpdateRule, DeleteRule string // can be null
RefTableCatalog, RefTableSchema, RefTableName, RefColName string // can be null
*datatug.Constraint
}
Constraint defines a constraint
type ConstraintsProvider ¶
type ConstraintsProvider interface {
// GetConstraints returns constrains
GetConstraints(c context.Context, 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
*datatug.IndexColumn
}
IndexColumn defines index column
type IndexColumnsProvider ¶
type IndexColumnsProvider interface {
// GetIndexColumns returns index columns
GetIndexColumns(c context.Context, 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, catalog, schema, table string) (IndexesReader, error)
}
IndexesProvider provides indexes
type IndexesReader ¶
IndexesReader provides indexes
type RecordsCountProvider ¶
type RecordsCountProvider interface {
RecordsCount(c context.Context, catalog, schema, table string) (*int, error)
}
RecordsCountProvider provides count for a recordset
type Scanner ¶
type Scanner interface {
ScanCatalog(c context.Context, name string) (database *datatug.DbCatalog, err error)
}
Scanner defines scanner
func NewScanner ¶
func NewScanner(schemaProvider SchemaProvider) Scanner
NewScanner creates new scanner
type SchemaProvider ¶
type SchemaProvider interface {
IsBulkProvider() bool // TODO: Needs clarification what it does and how it is used
CollectionsProvider
ColumnsProvider
IndexesProvider
IndexColumnsProvider
ConstraintsProvider
RecordsCountProvider
}
SchemaProvider provides schema info
type SortedIndexes ¶ added in v0.11.0
type SortedIndexes struct {
// contains filtered or unexported fields
}
func (*SortedIndexes) Reset ¶ added in v0.11.0
func (sorted *SortedIndexes) Reset()
func (*SortedIndexes) SequentialFind ¶ added in v0.11.0
func (sorted *SortedIndexes) SequentialFind(schema, table, name string) *Index
SequentialFind will work if calls to it are issued in lexical order
type SortedTables ¶ added in v0.11.0
type SortedTables struct {
Tables []*datatug.CollectionInfo
// contains filtered or unexported fields
}
func (*SortedTables) Reset ¶ added in v0.11.0
func (sorted *SortedTables) Reset()
func (*SortedTables) SequentialFind ¶ added in v0.11.0
func (sorted *SortedTables) SequentialFind(catalog, schema, name string) *datatug.CollectionInfo
SequentialFind will work if calls to it are issued in lexical order