Documentation ¶
Index ¶
- func NewDefaultWriter(r Reader, opts ...WriterOption) func(db DB, w io.Writer) Writer
- type BasicReader
- type Bool
- type Catalog
- type CatalogProvider
- type CatalogReader
- type CatalogSet
- func (r CatalogSet) Close() error
- func (r CatalogSet) Columns() ([]string, error)
- func (r CatalogSet) Err() error
- func (s CatalogSet) Get() Catalog
- func (r *CatalogSet) Len() int
- func (r *CatalogSet) Next() bool
- func (r CatalogSet) NextResultSet() bool
- func (r *CatalogSet) Reset()
- func (r CatalogSet) Scan(dest ...interface{}) error
- func (r *CatalogSet) SetColumns(c []string)
- func (r *CatalogSet) SetFilter(f func(Result) bool)
- func (r *CatalogSet) SetScanValues(s func(Result) []interface{})
- type CloseFunc
- type Column
- type ColumnPrivilege
- type ColumnPrivileges
- type ColumnReader
- type ColumnSet
- func (r ColumnSet) Close() error
- func (r ColumnSet) Columns() ([]string, error)
- func (r ColumnSet) Err() error
- func (c ColumnSet) Get() *Column
- func (r *ColumnSet) Len() int
- func (r *ColumnSet) Next() bool
- func (r ColumnSet) NextResultSet() bool
- func (r *ColumnSet) Reset()
- func (r ColumnSet) Scan(dest ...interface{}) error
- func (r *ColumnSet) SetColumns(c []string)
- func (r *ColumnSet) SetFilter(f func(Result) bool)
- func (r *ColumnSet) SetScanValues(s func(Result) []interface{})
- type ColumnStat
- type ColumnStatReader
- type ColumnStatSet
- func (r ColumnStatSet) Close() error
- func (r ColumnStatSet) Columns() ([]string, error)
- func (r ColumnStatSet) Err() error
- func (c ColumnStatSet) Get() *ColumnStat
- func (r *ColumnStatSet) Len() int
- func (r *ColumnStatSet) Next() bool
- func (r ColumnStatSet) NextResultSet() bool
- func (r *ColumnStatSet) Reset()
- func (r ColumnStatSet) Scan(dest ...interface{}) error
- func (r *ColumnStatSet) SetColumns(c []string)
- func (r *ColumnStatSet) SetFilter(f func(Result) bool)
- func (r *ColumnStatSet) SetScanValues(s func(Result) []interface{})
- type Constraint
- type ConstraintColumn
- type ConstraintColumnReader
- type ConstraintColumnSet
- func (r ConstraintColumnSet) Close() error
- func (r ConstraintColumnSet) Columns() ([]string, error)
- func (r ConstraintColumnSet) Err() error
- func (c ConstraintColumnSet) Get() *ConstraintColumn
- func (r *ConstraintColumnSet) Len() int
- func (r *ConstraintColumnSet) Next() bool
- func (r ConstraintColumnSet) NextResultSet() bool
- func (r *ConstraintColumnSet) Reset()
- func (r ConstraintColumnSet) Scan(dest ...interface{}) error
- func (r *ConstraintColumnSet) SetColumns(c []string)
- func (r *ConstraintColumnSet) SetFilter(f func(Result) bool)
- func (r *ConstraintColumnSet) SetScanValues(s func(Result) []interface{})
- type ConstraintReader
- type ConstraintSet
- func (r ConstraintSet) Close() error
- func (r ConstraintSet) Columns() ([]string, error)
- func (r ConstraintSet) Err() error
- func (i ConstraintSet) Get() *Constraint
- func (r *ConstraintSet) Len() int
- func (r *ConstraintSet) Next() bool
- func (r ConstraintSet) NextResultSet() bool
- func (r *ConstraintSet) Reset()
- func (r ConstraintSet) Scan(dest ...interface{}) error
- func (r *ConstraintSet) SetColumns(c []string)
- func (r *ConstraintSet) SetFilter(f func(Result) bool)
- func (r *ConstraintSet) SetScanValues(s func(Result) []interface{})
- type DB
- type DefaultWriter
- func (w DefaultWriter) DescribeFunctions(u *dburl.URL, funcTypes, pattern string, verbose, showSystem bool) error
- func (w DefaultWriter) DescribeTableDetails(u *dburl.URL, pattern string, verbose, showSystem bool) error
- func (w DefaultWriter) ListAllDbs(u *dburl.URL, pattern string, verbose bool) error
- func (w DefaultWriter) ListIndexes(u *dburl.URL, pattern string, verbose, showSystem bool) error
- func (w DefaultWriter) ListPrivilegeSummaries(u *dburl.URL, pattern string, showSystem bool) error
- func (w DefaultWriter) ListSchemas(u *dburl.URL, pattern string, verbose, showSystem bool) error
- func (w DefaultWriter) ListTables(u *dburl.URL, tableTypes, pattern string, verbose, showSystem bool) error
- func (w DefaultWriter) ShowStats(u *dburl.URL, statTypes, pattern string, verbose bool, k int) error
- type ExtendedReader
- type Filter
- type Function
- type FunctionColumn
- type FunctionColumnReader
- type FunctionColumnSet
- func (r FunctionColumnSet) Close() error
- func (r FunctionColumnSet) Columns() ([]string, error)
- func (r FunctionColumnSet) Err() error
- func (c FunctionColumnSet) Get() *FunctionColumn
- func (r *FunctionColumnSet) Len() int
- func (r *FunctionColumnSet) Next() bool
- func (r FunctionColumnSet) NextResultSet() bool
- func (r *FunctionColumnSet) Reset()
- func (r FunctionColumnSet) Scan(dest ...interface{}) error
- func (r *FunctionColumnSet) SetColumns(c []string)
- func (r *FunctionColumnSet) SetFilter(f func(Result) bool)
- func (r *FunctionColumnSet) SetScanValues(s func(Result) []interface{})
- type FunctionReader
- type FunctionSet
- func (r FunctionSet) Close() error
- func (r FunctionSet) Columns() ([]string, error)
- func (r FunctionSet) Err() error
- func (f FunctionSet) Get() *Function
- func (r *FunctionSet) Len() int
- func (r *FunctionSet) Next() bool
- func (r FunctionSet) NextResultSet() bool
- func (r *FunctionSet) Reset()
- func (r FunctionSet) Scan(dest ...interface{}) error
- func (r *FunctionSet) SetColumns(c []string)
- func (r *FunctionSet) SetFilter(f func(Result) bool)
- func (r *FunctionSet) SetScanValues(s func(Result) []interface{})
- type Index
- type IndexColumn
- type IndexColumnReader
- type IndexColumnSet
- func (r IndexColumnSet) Close() error
- func (r IndexColumnSet) Columns() ([]string, error)
- func (r IndexColumnSet) Err() error
- func (c IndexColumnSet) Get() *IndexColumn
- func (r *IndexColumnSet) Len() int
- func (r *IndexColumnSet) Next() bool
- func (r IndexColumnSet) NextResultSet() bool
- func (r *IndexColumnSet) Reset()
- func (r IndexColumnSet) Scan(dest ...interface{}) error
- func (r *IndexColumnSet) SetColumns(c []string)
- func (r *IndexColumnSet) SetFilter(f func(Result) bool)
- func (r *IndexColumnSet) SetScanValues(s func(Result) []interface{})
- type IndexReader
- type IndexSet
- func (r IndexSet) Close() error
- func (r IndexSet) Columns() ([]string, error)
- func (r IndexSet) Err() error
- func (i IndexSet) Get() *Index
- func (r *IndexSet) Len() int
- func (r *IndexSet) Next() bool
- func (r IndexSet) NextResultSet() bool
- func (r *IndexSet) Reset()
- func (r IndexSet) Scan(dest ...interface{}) error
- func (r *IndexSet) SetColumns(c []string)
- func (r *IndexSet) SetFilter(f func(Result) bool)
- func (r *IndexSet) SetScanValues(s func(Result) []interface{})
- type LoggingReader
- type ObjectPrivilege
- type ObjectPrivileges
- type PluginReader
- func (p PluginReader) Catalogs(f Filter) (*CatalogSet, error)
- func (p PluginReader) ColumnStats(f Filter) (*ColumnStatSet, error)
- func (p PluginReader) Columns(f Filter) (*ColumnSet, error)
- func (p PluginReader) ConstraintColumns(f Filter) (*ConstraintColumnSet, error)
- func (p PluginReader) Constraints(f Filter) (*ConstraintSet, error)
- func (p PluginReader) FunctionColumns(f Filter) (*FunctionColumnSet, error)
- func (p PluginReader) Functions(f Filter) (*FunctionSet, error)
- func (p PluginReader) IndexColumns(f Filter) (*IndexColumnSet, error)
- func (p PluginReader) Indexes(f Filter) (*IndexSet, error)
- func (p PluginReader) PrivilegeSummaries(f Filter) (*PrivilegeSummarySet, error)
- func (p PluginReader) Schemas(f Filter) (*SchemaSet, error)
- func (p PluginReader) Sequences(f Filter) (*SequenceSet, error)
- func (p PluginReader) Tables(f Filter) (*TableSet, error)
- func (p PluginReader) Triggers(f Filter) (*TriggerSet, error)
- type PrivilegeSummary
- type PrivilegeSummaryReader
- type PrivilegeSummarySet
- func (r PrivilegeSummarySet) Close() error
- func (r PrivilegeSummarySet) Columns() ([]string, error)
- func (r PrivilegeSummarySet) Err() error
- func (s PrivilegeSummarySet) Get() *PrivilegeSummary
- func (r *PrivilegeSummarySet) Len() int
- func (r *PrivilegeSummarySet) Next() bool
- func (r PrivilegeSummarySet) NextResultSet() bool
- func (r *PrivilegeSummarySet) Reset()
- func (r PrivilegeSummarySet) Scan(dest ...interface{}) error
- func (r *PrivilegeSummarySet) SetColumns(c []string)
- func (r *PrivilegeSummarySet) SetFilter(f func(Result) bool)
- func (r *PrivilegeSummarySet) SetScanValues(s func(Result) []interface{})
- type Reader
- type ReaderOption
- type Result
- type Schema
- type SchemaReader
- type SchemaSet
- func (r SchemaSet) Close() error
- func (r SchemaSet) Columns() ([]string, error)
- func (r SchemaSet) Err() error
- func (s SchemaSet) Get() *Schema
- func (r *SchemaSet) Len() int
- func (r *SchemaSet) Next() bool
- func (r SchemaSet) NextResultSet() bool
- func (r *SchemaSet) Reset()
- func (r SchemaSet) Scan(dest ...interface{}) error
- func (r *SchemaSet) SetColumns(c []string)
- func (r *SchemaSet) SetFilter(f func(Result) bool)
- func (r *SchemaSet) SetScanValues(s func(Result) []interface{})
- type Sequence
- type SequenceReader
- type SequenceSet
- func (r SequenceSet) Close() error
- func (r SequenceSet) Columns() ([]string, error)
- func (r SequenceSet) Err() error
- func (s SequenceSet) Get() *Sequence
- func (r *SequenceSet) Len() int
- func (r *SequenceSet) Next() bool
- func (r SequenceSet) NextResultSet() bool
- func (r *SequenceSet) Reset()
- func (r SequenceSet) Scan(dest ...interface{}) error
- func (r *SequenceSet) SetColumns(c []string)
- func (r *SequenceSet) SetFilter(f func(Result) bool)
- func (r *SequenceSet) SetScanValues(s func(Result) []interface{})
- type Table
- type TableReader
- type TableSet
- func (r TableSet) Close() error
- func (r TableSet) Columns() ([]string, error)
- func (r TableSet) Err() error
- func (t TableSet) Get() *Table
- func (r *TableSet) Len() int
- func (r *TableSet) Next() bool
- func (r TableSet) NextResultSet() bool
- func (r *TableSet) Reset()
- func (r TableSet) Scan(dest ...interface{}) error
- func (r *TableSet) SetColumns(c []string)
- func (r *TableSet) SetFilter(f func(Result) bool)
- func (r *TableSet) SetScanValues(s func(Result) []interface{})
- type Trigger
- type TriggerReader
- type TriggerSet
- func (r TriggerSet) Close() error
- func (r TriggerSet) Columns() ([]string, error)
- func (r TriggerSet) Err() error
- func (t TriggerSet) Get() *Trigger
- func (r *TriggerSet) Len() int
- func (r *TriggerSet) Next() bool
- func (r TriggerSet) NextResultSet() bool
- func (r *TriggerSet) Reset()
- func (r TriggerSet) Scan(dest ...interface{}) error
- func (r *TriggerSet) SetColumns(c []string)
- func (r *TriggerSet) SetFilter(f func(Result) bool)
- func (r *TriggerSet) SetScanValues(s func(Result) []interface{})
- type Writer
- type WriterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultWriter ¶
Types ¶
type BasicReader ¶
type BasicReader interface { SchemaReader TableReader ColumnReader }
BasicReader of common database metadata like schemas, tables and columns.
type CatalogProvider ¶
type CatalogProvider interface {
GetCatalog() Catalog
}
type CatalogReader ¶
type CatalogReader interface { Reader Catalogs(Filter) (*CatalogSet, error) }
CatalogReader lists database schemas.
type CatalogSet ¶
type CatalogSet struct {
// contains filtered or unexported fields
}
func NewCatalogSet ¶
func NewCatalogSet(v []Catalog) *CatalogSet
func NewCatalogSetWithColumns ¶
func NewCatalogSetWithColumns(v []Result, cols []string) *CatalogSet
func (CatalogSet) Get ¶
func (s CatalogSet) Get() Catalog
func (CatalogSet) NextResultSet ¶
func (r CatalogSet) NextResultSet() bool
func (*CatalogSet) SetColumns ¶
func (r *CatalogSet) SetColumns(c []string)
func (*CatalogSet) SetScanValues ¶
func (r *CatalogSet) SetScanValues(s func(Result) []interface{})
type CloseFunc ¶
type CloseFunc func()
CloseFunc should be called when result wont be processed anymore
type Column ¶
type ColumnPrivilege ¶
type ColumnPrivilege struct { Column string Grantee string Grantor string PrivilegeType string IsGrantable bool }
ColumnPrivilege represents a privilege granted on a column.
type ColumnPrivileges ¶
type ColumnPrivileges []ColumnPrivilege
ColumnPrivileges represents privileges granted on a column. The privileges are assumed to be sorted. Otherwise the String() method will fail.
func (ColumnPrivileges) Len ¶
func (p ColumnPrivileges) Len() int
func (ColumnPrivileges) Less ¶
func (p ColumnPrivileges) Less(i, j int) bool
func (ColumnPrivileges) String ¶
func (p ColumnPrivileges) String() string
String returns a string representation of ColumnPrivileges. Assumes the ColumnPrivileges to be sorted.
func (ColumnPrivileges) Swap ¶
func (p ColumnPrivileges) Swap(i, j int)
type ColumnReader ¶
ColumnReader lists table columns.
type ColumnSet ¶
type ColumnSet struct {
// contains filtered or unexported fields
}
func NewColumnSet ¶
func (ColumnSet) NextResultSet ¶
func (r ColumnSet) NextResultSet() bool
func (*ColumnSet) SetColumns ¶
func (r *ColumnSet) SetColumns(c []string)
func (*ColumnSet) SetScanValues ¶
func (r *ColumnSet) SetScanValues(s func(Result) []interface{})
type ColumnStat ¶
type ColumnStat struct { Catalog string Schema string Table string Name string AvgWidth int NullFrac float64 NumDistinct int64 Min string Max string Mean string TopN []string TopNFreqs []float64 }
func (ColumnStat) Values ¶
func (c ColumnStat) Values() []interface{}
type ColumnStatReader ¶
type ColumnStatReader interface { Reader ColumnStats(Filter) (*ColumnStatSet, error) }
ColumnStatsReader lists table column statistics.
type ColumnStatSet ¶
type ColumnStatSet struct {
// contains filtered or unexported fields
}
func NewColumnStatSet ¶
func NewColumnStatSet(v []ColumnStat) *ColumnStatSet
func (ColumnStatSet) Get ¶
func (c ColumnStatSet) Get() *ColumnStat
func (ColumnStatSet) NextResultSet ¶
func (r ColumnStatSet) NextResultSet() bool
func (*ColumnStatSet) SetColumns ¶
func (r *ColumnStatSet) SetColumns(c []string)
func (*ColumnStatSet) SetScanValues ¶
func (r *ColumnStatSet) SetScanValues(s func(Result) []interface{})
type Constraint ¶
type Constraint struct { Catalog string Schema string Table string Name string Type string IsDeferrable Bool IsInitiallyDeferred Bool ForeignCatalog string ForeignSchema string ForeignTable string ForeignName string MatchType string UpdateRule string DeleteRule string CheckClause string }
func (Constraint) Values ¶
func (i Constraint) Values() []interface{}
type ConstraintColumn ¶
type ConstraintColumn struct { Catalog string Schema string Table string Constraint string Name string OrdinalPosition int ForeignCatalog string ForeignSchema string ForeignTable string ForeignConstraint string ForeignName string }
func (ConstraintColumn) Values ¶
func (c ConstraintColumn) Values() []interface{}
type ConstraintColumnReader ¶
type ConstraintColumnReader interface { Reader ConstraintColumns(Filter) (*ConstraintColumnSet, error) }
ConstraintColumnReader lists constraint columns.
type ConstraintColumnSet ¶
type ConstraintColumnSet struct {
// contains filtered or unexported fields
}
func NewConstraintColumnSet ¶
func NewConstraintColumnSet(v []ConstraintColumn) *ConstraintColumnSet
func (ConstraintColumnSet) Get ¶
func (c ConstraintColumnSet) Get() *ConstraintColumn
func (ConstraintColumnSet) NextResultSet ¶
func (r ConstraintColumnSet) NextResultSet() bool
func (*ConstraintColumnSet) SetColumns ¶
func (r *ConstraintColumnSet) SetColumns(c []string)
func (*ConstraintColumnSet) SetScanValues ¶
func (r *ConstraintColumnSet) SetScanValues(s func(Result) []interface{})
type ConstraintReader ¶
type ConstraintReader interface { Reader Constraints(Filter) (*ConstraintSet, error) }
ConstraintReader lists table constraints.
type ConstraintSet ¶
type ConstraintSet struct {
// contains filtered or unexported fields
}
func NewConstraintSet ¶
func NewConstraintSet(v []Constraint) *ConstraintSet
func (ConstraintSet) Get ¶
func (i ConstraintSet) Get() *Constraint
func (ConstraintSet) NextResultSet ¶
func (r ConstraintSet) NextResultSet() bool
func (*ConstraintSet) SetColumns ¶
func (r *ConstraintSet) SetColumns(c []string)
func (*ConstraintSet) SetScanValues ¶
func (r *ConstraintSet) SetScanValues(s func(Result) []interface{})
type DB ¶
type DB interface { Exec(string, ...interface{}) (sql.Result, error) ExecContext(context.Context, string, ...interface{}) (sql.Result, error) Query(string, ...interface{}) (*sql.Rows, error) QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) QueryRow(string, ...interface{}) *sql.Row QueryRowContext(context.Context, string, ...interface{}) *sql.Row Prepare(string) (*sql.Stmt, error) PrepareContext(context.Context, string) (*sql.Stmt, error) }
DB is the common interface for database operations, compatible with database/sql.DB and database/sql.Tx.
type DefaultWriter ¶
type DefaultWriter struct {
// contains filtered or unexported fields
}
DefaultWriter using an existing db introspector
func (DefaultWriter) DescribeFunctions ¶
func (w DefaultWriter) DescribeFunctions(u *dburl.URL, funcTypes, pattern string, verbose, showSystem bool) error
DescribeFunctions matching pattern
func (DefaultWriter) DescribeTableDetails ¶
func (w DefaultWriter) DescribeTableDetails(u *dburl.URL, pattern string, verbose, showSystem bool) error
DescribeTableDetails matching pattern
func (DefaultWriter) ListAllDbs ¶
ListAllDbs matching pattern
func (DefaultWriter) ListIndexes ¶
ListIndexes matching pattern
func (DefaultWriter) ListPrivilegeSummaries ¶
ListPrivilegeSummaries matching pattern
func (DefaultWriter) ListSchemas ¶
ListSchemas matching pattern
func (DefaultWriter) ListTables ¶
func (w DefaultWriter) ListTables(u *dburl.URL, tableTypes, pattern string, verbose, showSystem bool) error
ListTables matching pattern
type ExtendedReader ¶
type ExtendedReader interface { CatalogReader SchemaReader TableReader ColumnReader ColumnStatReader IndexReader IndexColumnReader TriggerReader ConstraintReader ConstraintColumnReader FunctionReader FunctionColumnReader SequenceReader PrivilegeSummaryReader }
ExtendedReader of all database metadata in a structured format.
type Filter ¶
type Filter struct { // Catalog name pattern that objects must belong to; // use Name to filter catalogs by name Catalog string // Schema name pattern that objects must belong to; // use Name to filter schemas by name Schema string // Parent name pattern that objects must belong to; // does not apply to schema and catalog containing matching objects Parent string // Reference name pattern of other objects referencing this one, Reference string // Name pattern that object name must match Name string // Types of the object Types []string // WithSystem objects WithSystem bool // OnlyVisible objects OnlyVisible bool }
Filter objects returned by Readers
type Function ¶
type FunctionColumn ¶
type FunctionColumn struct { Catalog string Schema string Table string Name string FunctionName string OrdinalPosition int Type string DataType string // ScanType reflect.Type ColumnSize int DecimalDigits int NumPrecRadix int CharOctetLength int }
func (FunctionColumn) Values ¶
func (c FunctionColumn) Values() []interface{}
type FunctionColumnReader ¶
type FunctionColumnReader interface { Reader FunctionColumns(Filter) (*FunctionColumnSet, error) }
FunctionColumnReader lists function parameters.
type FunctionColumnSet ¶
type FunctionColumnSet struct {
// contains filtered or unexported fields
}
func NewFunctionColumnSet ¶
func NewFunctionColumnSet(v []FunctionColumn) *FunctionColumnSet
func (FunctionColumnSet) Get ¶
func (c FunctionColumnSet) Get() *FunctionColumn
func (FunctionColumnSet) NextResultSet ¶
func (r FunctionColumnSet) NextResultSet() bool
func (*FunctionColumnSet) SetColumns ¶
func (r *FunctionColumnSet) SetColumns(c []string)
func (*FunctionColumnSet) SetScanValues ¶
func (r *FunctionColumnSet) SetScanValues(s func(Result) []interface{})
type FunctionReader ¶
type FunctionReader interface { Reader Functions(Filter) (*FunctionSet, error) }
FunctionReader lists database functions.
type FunctionSet ¶
type FunctionSet struct {
// contains filtered or unexported fields
}
func NewFunctionSet ¶
func NewFunctionSet(v []Function) *FunctionSet
func (FunctionSet) Get ¶
func (f FunctionSet) Get() *Function
func (FunctionSet) NextResultSet ¶
func (r FunctionSet) NextResultSet() bool
func (*FunctionSet) SetColumns ¶
func (r *FunctionSet) SetColumns(c []string)
func (*FunctionSet) SetScanValues ¶
func (r *FunctionSet) SetScanValues(s func(Result) []interface{})
type Index ¶
type IndexColumn ¶
type IndexColumn struct { Catalog string Schema string Table string IndexName string Name string DataType string OrdinalPosition int }
func (IndexColumn) Values ¶
func (c IndexColumn) Values() []interface{}
type IndexColumnReader ¶
type IndexColumnReader interface { Reader IndexColumns(Filter) (*IndexColumnSet, error) }
IndexColumnReader lists index columns.
type IndexColumnSet ¶
type IndexColumnSet struct {
// contains filtered or unexported fields
}
func NewIndexColumnSet ¶
func NewIndexColumnSet(v []IndexColumn) *IndexColumnSet
func (IndexColumnSet) Get ¶
func (c IndexColumnSet) Get() *IndexColumn
func (IndexColumnSet) NextResultSet ¶
func (r IndexColumnSet) NextResultSet() bool
func (*IndexColumnSet) SetColumns ¶
func (r *IndexColumnSet) SetColumns(c []string)
func (*IndexColumnSet) SetScanValues ¶
func (r *IndexColumnSet) SetScanValues(s func(Result) []interface{})
type IndexReader ¶
IndexReader lists table indexes.
type IndexSet ¶
type IndexSet struct {
// contains filtered or unexported fields
}
func NewIndexSet ¶
func (IndexSet) NextResultSet ¶
func (r IndexSet) NextResultSet() bool
func (*IndexSet) SetColumns ¶
func (r *IndexSet) SetColumns(c []string)
func (*IndexSet) SetScanValues ¶
func (r *IndexSet) SetScanValues(s func(Result) []interface{})
type LoggingReader ¶
type LoggingReader struct {
// contains filtered or unexported fields
}
func NewLoggingReader ¶
func NewLoggingReader(db DB, opts ...ReaderOption) LoggingReader
type ObjectPrivilege ¶
ObjectPrivilege represents a privilege granted on a database object.
type ObjectPrivileges ¶
type ObjectPrivileges []ObjectPrivilege
ObjectPrivileges represents privileges granted on a database object. The privileges are assumed to be sorted. Otherwise the String() method will fail.
func (ObjectPrivileges) Len ¶
func (p ObjectPrivileges) Len() int
func (ObjectPrivileges) Less ¶
func (p ObjectPrivileges) Less(i, j int) bool
func (ObjectPrivileges) String ¶
func (p ObjectPrivileges) String() string
String returns a string representation of ObjectPrivileges. Assumes the ObjectPrivileges to be sorted.
func (ObjectPrivileges) Swap ¶
func (p ObjectPrivileges) Swap(i, j int)
type PluginReader ¶
type PluginReader struct {
// contains filtered or unexported fields
}
PluginReader allows to be easily composed from other readers
func (PluginReader) Catalogs ¶
func (p PluginReader) Catalogs(f Filter) (*CatalogSet, error)
func (PluginReader) ColumnStats ¶
func (p PluginReader) ColumnStats(f Filter) (*ColumnStatSet, error)
func (PluginReader) ConstraintColumns ¶
func (p PluginReader) ConstraintColumns(f Filter) (*ConstraintColumnSet, error)
func (PluginReader) Constraints ¶
func (p PluginReader) Constraints(f Filter) (*ConstraintSet, error)
func (PluginReader) FunctionColumns ¶
func (p PluginReader) FunctionColumns(f Filter) (*FunctionColumnSet, error)
func (PluginReader) Functions ¶
func (p PluginReader) Functions(f Filter) (*FunctionSet, error)
func (PluginReader) IndexColumns ¶
func (p PluginReader) IndexColumns(f Filter) (*IndexColumnSet, error)
func (PluginReader) PrivilegeSummaries ¶
func (p PluginReader) PrivilegeSummaries(f Filter) (*PrivilegeSummarySet, error)
func (PluginReader) Sequences ¶
func (p PluginReader) Sequences(f Filter) (*SequenceSet, error)
func (PluginReader) Triggers ¶
func (p PluginReader) Triggers(f Filter) (*TriggerSet, error)
type PrivilegeSummary ¶
type PrivilegeSummary struct { Catalog string Schema string Name string ObjectType string ObjectPrivileges ObjectPrivileges ColumnPrivileges ColumnPrivileges }
PrivilegeSummary summarizes the privileges granted on a database object
func (PrivilegeSummary) Values ¶
func (s PrivilegeSummary) Values() []interface{}
type PrivilegeSummaryReader ¶
type PrivilegeSummaryReader interface { Reader PrivilegeSummaries(Filter) (*PrivilegeSummarySet, error) }
PrivilegeSummaryReader lists summaries of privileges granted on tables, views and sequences.
type PrivilegeSummarySet ¶
type PrivilegeSummarySet struct {
// contains filtered or unexported fields
}
func NewPrivilegeSummarySet ¶
func NewPrivilegeSummarySet(v []PrivilegeSummary) *PrivilegeSummarySet
func (PrivilegeSummarySet) Get ¶
func (s PrivilegeSummarySet) Get() *PrivilegeSummary
func (PrivilegeSummarySet) NextResultSet ¶
func (r PrivilegeSummarySet) NextResultSet() bool
func (*PrivilegeSummarySet) SetColumns ¶
func (r *PrivilegeSummarySet) SetColumns(c []string)
func (*PrivilegeSummarySet) SetScanValues ¶
func (r *PrivilegeSummarySet) SetScanValues(s func(Result) []interface{})
type Reader ¶
type Reader interface{}
Reader of any database metadata in a structured format.
func NewPluginReader ¶
NewPluginReader allows to be easily composed from other readers
type ReaderOption ¶
type ReaderOption func(Reader)
ReaderOption to configure the reader
func WithDryRun ¶
func WithDryRun(d bool) ReaderOption
WithDryRun allows to avoid running any queries
func WithLimit ¶
func WithLimit(l int) ReaderOption
WithLimit for a single query, if the reader supports it
func WithLogger ¶
func WithLogger(l logger) ReaderOption
WithLogger used to log queries before executing them
type SchemaReader ¶
SchemaReader lists database schemas.
type SchemaSet ¶
type SchemaSet struct {
// contains filtered or unexported fields
}
func NewSchemaSet ¶
func (SchemaSet) NextResultSet ¶
func (r SchemaSet) NextResultSet() bool
func (*SchemaSet) SetColumns ¶
func (r *SchemaSet) SetColumns(c []string)
func (*SchemaSet) SetScanValues ¶
func (r *SchemaSet) SetScanValues(s func(Result) []interface{})
type Sequence ¶
type SequenceReader ¶
type SequenceReader interface { Reader Sequences(Filter) (*SequenceSet, error) }
SequenceReader lists sequences.
type SequenceSet ¶
type SequenceSet struct {
// contains filtered or unexported fields
}
func NewSequenceSet ¶
func NewSequenceSet(v []Sequence) *SequenceSet
func (SequenceSet) Get ¶
func (s SequenceSet) Get() *Sequence
func (SequenceSet) NextResultSet ¶
func (r SequenceSet) NextResultSet() bool
func (*SequenceSet) SetColumns ¶
func (r *SequenceSet) SetColumns(c []string)
func (*SequenceSet) SetScanValues ¶
func (r *SequenceSet) SetScanValues(s func(Result) []interface{})
type Table ¶
type TableReader ¶
TableReader lists database tables.
type TableSet ¶
type TableSet struct {
// contains filtered or unexported fields
}
func NewTableSet ¶
func (TableSet) NextResultSet ¶
func (r TableSet) NextResultSet() bool
func (*TableSet) SetColumns ¶
func (r *TableSet) SetColumns(c []string)
func (*TableSet) SetScanValues ¶
func (r *TableSet) SetScanValues(s func(Result) []interface{})
type TriggerReader ¶
type TriggerReader interface { Reader Triggers(Filter) (*TriggerSet, error) }
TriggerReader lists table triggers.
type TriggerSet ¶
type TriggerSet struct {
// contains filtered or unexported fields
}
func NewTriggerSet ¶
func NewTriggerSet(t []Trigger) *TriggerSet
func (TriggerSet) Get ¶
func (t TriggerSet) Get() *Trigger
func (TriggerSet) NextResultSet ¶
func (r TriggerSet) NextResultSet() bool
func (*TriggerSet) SetColumns ¶
func (r *TriggerSet) SetColumns(c []string)
func (*TriggerSet) SetScanValues ¶
func (r *TriggerSet) SetScanValues(s func(Result) []interface{})
type Writer ¶
type Writer interface { // DescribeFunctions \df, \dfa, \dfn, \dft, \dfw, etc. DescribeFunctions(*dburl.URL, string, string, bool, bool) error // DescribeTableDetails \d foo DescribeTableDetails(*dburl.URL, string, bool, bool) error // ListAllDbs \l ListAllDbs(*dburl.URL, string, bool) error // ListTables \dt, \dv, \dm, etc. ListTables(*dburl.URL, string, string, bool, bool) error // ListSchemas \dn ListSchemas(*dburl.URL, string, bool, bool) error // ListIndexes \di ListIndexes(*dburl.URL, string, bool, bool) error // ShowStats \ss ShowStats(*dburl.URL, string, string, bool, int) error // ListPrivilegeSummaries \dp ListPrivilegeSummaries(*dburl.URL, string, bool) error }
Writer of database metadata in a human readable format.
type WriterOption ¶
type WriterOption func(*DefaultWriter)
WriterOption to configure the DefaultWriter
func WithListAllDbs ¶
func WithListAllDbs(f func(string, bool) error) WriterOption
WithListAllDbs that lists all catalogs
func WithSystemSchemas ¶
func WithSystemSchemas(schemas []string) WriterOption
WithSystemSchemas that are ignored unless showSystem is true
Directories ¶
Path | Synopsis |
---|---|
Package informationschema provides metadata readers that query tables from the information_schema schema.
|
Package informationschema provides metadata readers that query tables from the information_schema schema. |
Package oracle provides a metadata reader
|
Package oracle provides a metadata reader |
Package postgres provides a metadata reader
|
Package postgres provides a metadata reader |