metadata

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultWriter

func NewDefaultWriter(r Reader, opts ...WriterOption) func(db DB, w io.Writer) Writer

Types

type BasicReader

type BasicReader interface {
	SchemaReader
	TableReader
	ColumnReader
}

BasicReader of common database metadata like schemas, tables and columns.

type Bool

type Bool string
var (
	UNKNOWN Bool = ""
	YES     Bool = "YES"
	NO      Bool = "NO"
)

type Catalog

type Catalog struct {
	Catalog string
}

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 (CatalogSet) Close

func (r CatalogSet) Close() error

func (CatalogSet) Columns

func (r CatalogSet) Columns() ([]string, error)

func (CatalogSet) Err

func (r CatalogSet) Err() error

func (CatalogSet) Get

func (s CatalogSet) Get() *Catalog

func (*CatalogSet) Len

func (r *CatalogSet) Len() int

func (*CatalogSet) Next

func (r *CatalogSet) Next() bool

func (CatalogSet) NextResultSet

func (r CatalogSet) NextResultSet() bool

func (*CatalogSet) Reset

func (r *CatalogSet) Reset()

func (CatalogSet) Scan

func (r CatalogSet) Scan(dest ...interface{}) error

func (*CatalogSet) SetColumns

func (r *CatalogSet) SetColumns(c []string)

func (*CatalogSet) SetFilter

func (r *CatalogSet) SetFilter(f func(Result) bool)

func (*CatalogSet) SetScanValues

func (r *CatalogSet) SetScanValues(s func(Result) []interface{})

type CloseFunc added in v0.9.0

type CloseFunc func()

CloseFunc should be called when result wont be processed anymore

type Column

type Column struct {
	Catalog         string
	Schema          string
	Table           string
	Name            string
	OrdinalPosition int
	DataType        string
	// ScanType        reflect.Type
	Default         string
	ColumnSize      int
	DecimalDigits   int
	NumPrecRadix    int
	CharOctetLength int
	IsNullable      Bool
}

type ColumnReader

type ColumnReader interface {
	Reader
	Columns(Filter) (*ColumnSet, error)
}

ColumnReader lists table columns.

type ColumnSet

type ColumnSet struct {
	// contains filtered or unexported fields
}

func NewColumnSet

func NewColumnSet(v []Column) *ColumnSet

func (ColumnSet) Close

func (r ColumnSet) Close() error

func (ColumnSet) Columns

func (r ColumnSet) Columns() ([]string, error)

func (ColumnSet) Err

func (r ColumnSet) Err() error

func (ColumnSet) Get

func (c ColumnSet) Get() *Column

func (*ColumnSet) Len

func (r *ColumnSet) Len() int

func (*ColumnSet) Next

func (r *ColumnSet) Next() bool

func (ColumnSet) NextResultSet

func (r ColumnSet) NextResultSet() bool

func (*ColumnSet) Reset

func (r *ColumnSet) Reset()

func (ColumnSet) Scan

func (r ColumnSet) Scan(dest ...interface{}) error

func (*ColumnSet) SetColumns

func (r *ColumnSet) SetColumns(c []string)

func (*ColumnSet) SetFilter

func (r *ColumnSet) SetFilter(f func(Result) bool)

func (*ColumnSet) SetScanValues

func (r *ColumnSet) SetScanValues(s func(Result) []interface{})

type ColumnStat added in v0.9.5

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
}

type ColumnStatReader added in v0.9.5

type ColumnStatReader interface {
	Reader
	ColumnStats(Filter) (*ColumnStatSet, error)
}

ColumnStatsReader lists table column statistics.

type ColumnStatSet added in v0.9.5

type ColumnStatSet struct {
	// contains filtered or unexported fields
}

func NewColumnStatSet added in v0.9.5

func NewColumnStatSet(v []ColumnStat) *ColumnStatSet

func (ColumnStatSet) Close added in v0.9.5

func (r ColumnStatSet) Close() error

func (ColumnStatSet) Columns added in v0.9.5

func (r ColumnStatSet) Columns() ([]string, error)

func (ColumnStatSet) Err added in v0.9.5

func (r ColumnStatSet) Err() error

func (ColumnStatSet) Get added in v0.9.5

func (c ColumnStatSet) Get() *ColumnStat

func (*ColumnStatSet) Len added in v0.9.5

func (r *ColumnStatSet) Len() int

func (*ColumnStatSet) Next added in v0.9.5

func (r *ColumnStatSet) Next() bool

func (ColumnStatSet) NextResultSet added in v0.9.5

func (r ColumnStatSet) NextResultSet() bool

func (*ColumnStatSet) Reset added in v0.9.5

func (r *ColumnStatSet) Reset()

func (ColumnStatSet) Scan added in v0.9.5

func (r ColumnStatSet) Scan(dest ...interface{}) error

func (*ColumnStatSet) SetColumns added in v0.9.5

func (r *ColumnStatSet) SetColumns(c []string)

func (*ColumnStatSet) SetFilter added in v0.9.5

func (r *ColumnStatSet) SetFilter(f func(Result) bool)

func (*ColumnStatSet) SetScanValues added in v0.9.5

func (r *ColumnStatSet) SetScanValues(s func(Result) []interface{})

type Constraint added in v0.9.0

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
}

type ConstraintColumn added in v0.9.0

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
}

type ConstraintColumnReader added in v0.9.0

type ConstraintColumnReader interface {
	Reader
	ConstraintColumns(Filter) (*ConstraintColumnSet, error)
}

ConstraintColumnReader lists constraint columns.

type ConstraintColumnSet added in v0.9.0

type ConstraintColumnSet struct {
	// contains filtered or unexported fields
}

func NewConstraintColumnSet added in v0.9.0

func NewConstraintColumnSet(v []ConstraintColumn) *ConstraintColumnSet

func (ConstraintColumnSet) Close added in v0.9.0

func (r ConstraintColumnSet) Close() error

func (ConstraintColumnSet) Columns added in v0.9.0

func (r ConstraintColumnSet) Columns() ([]string, error)

func (ConstraintColumnSet) Err added in v0.9.0

func (r ConstraintColumnSet) Err() error

func (ConstraintColumnSet) Get added in v0.9.0

func (*ConstraintColumnSet) Len added in v0.9.0

func (r *ConstraintColumnSet) Len() int

func (*ConstraintColumnSet) Next added in v0.9.0

func (r *ConstraintColumnSet) Next() bool

func (ConstraintColumnSet) NextResultSet added in v0.9.0

func (r ConstraintColumnSet) NextResultSet() bool

func (*ConstraintColumnSet) Reset added in v0.9.0

func (r *ConstraintColumnSet) Reset()

func (ConstraintColumnSet) Scan added in v0.9.0

func (r ConstraintColumnSet) Scan(dest ...interface{}) error

func (*ConstraintColumnSet) SetColumns added in v0.9.0

func (r *ConstraintColumnSet) SetColumns(c []string)

func (*ConstraintColumnSet) SetFilter added in v0.9.0

func (r *ConstraintColumnSet) SetFilter(f func(Result) bool)

func (*ConstraintColumnSet) SetScanValues added in v0.9.0

func (r *ConstraintColumnSet) SetScanValues(s func(Result) []interface{})

type ConstraintReader added in v0.9.0

type ConstraintReader interface {
	Reader
	Constraints(Filter) (*ConstraintSet, error)
}

ConstraintReader lists table constraints.

type ConstraintSet added in v0.9.0

type ConstraintSet struct {
	// contains filtered or unexported fields
}

func NewConstraintSet added in v0.9.0

func NewConstraintSet(v []Constraint) *ConstraintSet

func (ConstraintSet) Close added in v0.9.0

func (r ConstraintSet) Close() error

func (ConstraintSet) Columns added in v0.9.0

func (r ConstraintSet) Columns() ([]string, error)

func (ConstraintSet) Err added in v0.9.0

func (r ConstraintSet) Err() error

func (ConstraintSet) Get added in v0.9.0

func (i ConstraintSet) Get() *Constraint

func (*ConstraintSet) Len added in v0.9.0

func (r *ConstraintSet) Len() int

func (*ConstraintSet) Next added in v0.9.0

func (r *ConstraintSet) Next() bool

func (ConstraintSet) NextResultSet added in v0.9.0

func (r ConstraintSet) NextResultSet() bool

func (*ConstraintSet) Reset added in v0.9.0

func (r *ConstraintSet) Reset()

func (ConstraintSet) Scan added in v0.9.0

func (r ConstraintSet) Scan(dest ...interface{}) error

func (*ConstraintSet) SetColumns added in v0.9.0

func (r *ConstraintSet) SetColumns(c []string)

func (*ConstraintSet) SetFilter added in v0.9.0

func (r *ConstraintSet) SetFilter(f func(Result) bool)

func (*ConstraintSet) SetScanValues added in v0.9.0

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

func (w DefaultWriter) ListAllDbs(u *dburl.URL, pattern string, verbose bool) error

ListAllDbs matching pattern

func (DefaultWriter) ListIndexes

func (w DefaultWriter) ListIndexes(u *dburl.URL, pattern string, verbose, showSystem bool) error

ListIndexes matching pattern

func (DefaultWriter) ListSchemas

func (w DefaultWriter) ListSchemas(u *dburl.URL, pattern string, verbose, showSystem bool) error

ListSchemas matching pattern

func (DefaultWriter) ListTables

func (w DefaultWriter) ListTables(u *dburl.URL, tableTypes, pattern string, verbose, showSystem bool) error

ListTables matching pattern

func (DefaultWriter) ShowStats added in v0.9.5

func (w DefaultWriter) ShowStats(u *dburl.URL, statTypes, pattern string, verbose bool, k int) error

ShowStats of columns for tables matching pattern

type Filter added in v0.9.0

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 Function struct {
	Catalog    string
	Schema     string
	Name       string
	ResultType string
	ArgTypes   string
	Type       string
	Volatility string
	Security   string
	Language   string
	Source     string

	SpecificName string
}

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
}

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) Close

func (r FunctionColumnSet) Close() error

func (FunctionColumnSet) Columns

func (r FunctionColumnSet) Columns() ([]string, error)

func (FunctionColumnSet) Err

func (r FunctionColumnSet) Err() error

func (FunctionColumnSet) Get

func (*FunctionColumnSet) Len

func (r *FunctionColumnSet) Len() int

func (*FunctionColumnSet) Next

func (r *FunctionColumnSet) Next() bool

func (FunctionColumnSet) NextResultSet

func (r FunctionColumnSet) NextResultSet() bool

func (*FunctionColumnSet) Reset

func (r *FunctionColumnSet) Reset()

func (FunctionColumnSet) Scan

func (r FunctionColumnSet) Scan(dest ...interface{}) error

func (*FunctionColumnSet) SetColumns

func (r *FunctionColumnSet) SetColumns(c []string)

func (*FunctionColumnSet) SetFilter

func (r *FunctionColumnSet) SetFilter(f func(Result) bool)

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) Close

func (r FunctionSet) Close() error

func (FunctionSet) Columns

func (r FunctionSet) Columns() ([]string, error)

func (FunctionSet) Err

func (r FunctionSet) Err() error

func (FunctionSet) Get

func (f FunctionSet) Get() *Function

func (*FunctionSet) Len

func (r *FunctionSet) Len() int

func (*FunctionSet) Next

func (r *FunctionSet) Next() bool

func (FunctionSet) NextResultSet

func (r FunctionSet) NextResultSet() bool

func (*FunctionSet) Reset

func (r *FunctionSet) Reset()

func (FunctionSet) Scan

func (r FunctionSet) Scan(dest ...interface{}) error

func (*FunctionSet) SetColumns

func (r *FunctionSet) SetColumns(c []string)

func (*FunctionSet) SetFilter

func (r *FunctionSet) SetFilter(f func(Result) bool)

func (*FunctionSet) SetScanValues

func (r *FunctionSet) SetScanValues(s func(Result) []interface{})

type Index

type Index struct {
	Catalog   string
	Schema    string
	Table     string
	Name      string
	IsPrimary Bool
	IsUnique  Bool
	Type      string
	Columns   string
}

type IndexColumn

type IndexColumn struct {
	Catalog         string
	Schema          string
	Table           string
	IndexName       string
	Name            string
	DataType        string
	OrdinalPosition int
}

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) Close

func (r IndexColumnSet) Close() error

func (IndexColumnSet) Columns

func (r IndexColumnSet) Columns() ([]string, error)

func (IndexColumnSet) Err

func (r IndexColumnSet) Err() error

func (IndexColumnSet) Get

func (c IndexColumnSet) Get() *IndexColumn

func (*IndexColumnSet) Len

func (r *IndexColumnSet) Len() int

func (*IndexColumnSet) Next

func (r *IndexColumnSet) Next() bool

func (IndexColumnSet) NextResultSet

func (r IndexColumnSet) NextResultSet() bool

func (*IndexColumnSet) Reset

func (r *IndexColumnSet) Reset()

func (IndexColumnSet) Scan

func (r IndexColumnSet) Scan(dest ...interface{}) error

func (*IndexColumnSet) SetColumns

func (r *IndexColumnSet) SetColumns(c []string)

func (*IndexColumnSet) SetFilter

func (r *IndexColumnSet) SetFilter(f func(Result) bool)

func (*IndexColumnSet) SetScanValues

func (r *IndexColumnSet) SetScanValues(s func(Result) []interface{})

type IndexReader

type IndexReader interface {
	Reader
	Indexes(Filter) (*IndexSet, error)
}

IndexReader lists table indexes.

type IndexSet

type IndexSet struct {
	// contains filtered or unexported fields
}

func NewIndexSet

func NewIndexSet(v []Index) *IndexSet

func (IndexSet) Close

func (r IndexSet) Close() error

func (IndexSet) Columns

func (r IndexSet) Columns() ([]string, error)

func (IndexSet) Err

func (r IndexSet) Err() error

func (IndexSet) Get

func (i IndexSet) Get() *Index

func (*IndexSet) Len

func (r *IndexSet) Len() int

func (*IndexSet) Next

func (r *IndexSet) Next() bool

func (IndexSet) NextResultSet

func (r IndexSet) NextResultSet() bool

func (*IndexSet) Reset

func (r *IndexSet) Reset()

func (IndexSet) Scan

func (r IndexSet) Scan(dest ...interface{}) error

func (*IndexSet) SetColumns

func (r *IndexSet) SetColumns(c []string)

func (*IndexSet) SetFilter

func (r *IndexSet) SetFilter(f func(Result) bool)

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

func (LoggingReader) Query

func (r LoggingReader) Query(q string, v ...interface{}) (*sql.Rows, CloseFunc, error)

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 added in v0.9.5

func (p PluginReader) ColumnStats(f Filter) (*ColumnStatSet, error)

func (PluginReader) Columns

func (p PluginReader) Columns(f Filter) (*ColumnSet, error)

func (PluginReader) ConstraintColumns added in v0.9.0

func (p PluginReader) ConstraintColumns(f Filter) (*ConstraintColumnSet, error)

func (PluginReader) Constraints added in v0.9.0

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) Indexes

func (p PluginReader) Indexes(f Filter) (*IndexSet, error)

func (PluginReader) Schemas

func (p PluginReader) Schemas(f Filter) (*SchemaSet, error)

func (PluginReader) Sequences

func (p PluginReader) Sequences(f Filter) (*SequenceSet, error)

func (PluginReader) Tables

func (p PluginReader) Tables(f Filter) (*TableSet, error)

func (PluginReader) Triggers added in v0.9.3

func (p PluginReader) Triggers(f Filter) (*TriggerSet, error)

type Reader

type Reader interface{}

Reader of any database metadata in a structured format.

func NewPluginReader

func NewPluginReader(readers ...Reader) Reader

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 added in v0.9.0

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

func WithTimeout added in v0.9.0

func WithTimeout(t time.Duration) ReaderOption

WithTimeout for a single query

type Result

type Result interface {
	// contains filtered or unexported methods
}

type Schema

type Schema struct {
	Schema  string
	Catalog string
}

type SchemaReader

type SchemaReader interface {
	Reader
	Schemas(Filter) (*SchemaSet, error)
}

SchemaReader lists database schemas.

type SchemaSet

type SchemaSet struct {
	// contains filtered or unexported fields
}

func NewSchemaSet

func NewSchemaSet(v []Schema) *SchemaSet

func (SchemaSet) Close

func (r SchemaSet) Close() error

func (SchemaSet) Columns

func (r SchemaSet) Columns() ([]string, error)

func (SchemaSet) Err

func (r SchemaSet) Err() error

func (SchemaSet) Get

func (s SchemaSet) Get() *Schema

func (*SchemaSet) Len

func (r *SchemaSet) Len() int

func (*SchemaSet) Next

func (r *SchemaSet) Next() bool

func (SchemaSet) NextResultSet

func (r SchemaSet) NextResultSet() bool

func (*SchemaSet) Reset

func (r *SchemaSet) Reset()

func (SchemaSet) Scan

func (r SchemaSet) Scan(dest ...interface{}) error

func (*SchemaSet) SetColumns

func (r *SchemaSet) SetColumns(c []string)

func (*SchemaSet) SetFilter

func (r *SchemaSet) SetFilter(f func(Result) bool)

func (*SchemaSet) SetScanValues

func (r *SchemaSet) SetScanValues(s func(Result) []interface{})

type Sequence

type Sequence struct {
	Catalog   string
	Schema    string
	Name      string
	DataType  string
	Start     string
	Min       string
	Max       string
	Increment string
	Cycles    Bool
}

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) Close

func (r SequenceSet) Close() error

func (SequenceSet) Columns

func (r SequenceSet) Columns() ([]string, error)

func (SequenceSet) Err

func (r SequenceSet) Err() error

func (SequenceSet) Get

func (s SequenceSet) Get() *Sequence

func (*SequenceSet) Len

func (r *SequenceSet) Len() int

func (*SequenceSet) Next

func (r *SequenceSet) Next() bool

func (SequenceSet) NextResultSet

func (r SequenceSet) NextResultSet() bool

func (*SequenceSet) Reset

func (r *SequenceSet) Reset()

func (SequenceSet) Scan

func (r SequenceSet) Scan(dest ...interface{}) error

func (*SequenceSet) SetColumns

func (r *SequenceSet) SetColumns(c []string)

func (*SequenceSet) SetFilter

func (r *SequenceSet) SetFilter(f func(Result) bool)

func (*SequenceSet) SetScanValues

func (r *SequenceSet) SetScanValues(s func(Result) []interface{})

type Table

type Table struct {
	Catalog string
	Schema  string
	Name    string
	Type    string
	Rows    int64
	Size    string
	Comment string
}

type TableReader

type TableReader interface {
	Reader
	Tables(Filter) (*TableSet, error)
}

TableReader lists database tables.

type TableSet

type TableSet struct {
	// contains filtered or unexported fields
}

func NewTableSet

func NewTableSet(v []Table) *TableSet

func (TableSet) Close

func (r TableSet) Close() error

func (TableSet) Columns

func (r TableSet) Columns() ([]string, error)

func (TableSet) Err

func (r TableSet) Err() error

func (TableSet) Get

func (t TableSet) Get() *Table

func (*TableSet) Len

func (r *TableSet) Len() int

func (*TableSet) Next

func (r *TableSet) Next() bool

func (TableSet) NextResultSet

func (r TableSet) NextResultSet() bool

func (*TableSet) Reset

func (r *TableSet) Reset()

func (TableSet) Scan

func (r TableSet) Scan(dest ...interface{}) error

func (*TableSet) SetColumns

func (r *TableSet) SetColumns(c []string)

func (*TableSet) SetFilter

func (r *TableSet) SetFilter(f func(Result) bool)

func (*TableSet) SetScanValues

func (r *TableSet) SetScanValues(s func(Result) []interface{})

type Trigger added in v0.9.3

type Trigger struct {
	Catalog    string
	Schema     string
	Table      string
	Name       string
	Definition string
}

type TriggerReader added in v0.9.3

type TriggerReader interface {
	Reader
	Triggers(Filter) (*TriggerSet, error)
}

TriggerReader lists table triggers.

type TriggerSet added in v0.9.3

type TriggerSet struct {
	// contains filtered or unexported fields
}

func NewTriggerSet added in v0.9.3

func NewTriggerSet(t []Trigger) *TriggerSet

func (TriggerSet) Close added in v0.9.3

func (r TriggerSet) Close() error

func (TriggerSet) Columns added in v0.9.3

func (r TriggerSet) Columns() ([]string, error)

func (TriggerSet) Err added in v0.9.3

func (r TriggerSet) Err() error

func (TriggerSet) Get added in v0.9.3

func (t TriggerSet) Get() *Trigger

func (*TriggerSet) Len added in v0.9.3

func (r *TriggerSet) Len() int

func (*TriggerSet) Next added in v0.9.3

func (r *TriggerSet) Next() bool

func (TriggerSet) NextResultSet added in v0.9.3

func (r TriggerSet) NextResultSet() bool

func (*TriggerSet) Reset added in v0.9.3

func (r *TriggerSet) Reset()

func (TriggerSet) Scan added in v0.9.3

func (r TriggerSet) Scan(dest ...interface{}) error

func (*TriggerSet) SetColumns added in v0.9.3

func (r *TriggerSet) SetColumns(c []string)

func (*TriggerSet) SetFilter added in v0.9.3

func (r *TriggerSet) SetFilter(f func(Result) bool)

func (*TriggerSet) SetScanValues added in v0.9.3

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
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL