Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnOpts ¶
type ConnOpts struct {
DSN string
Timeout time.Duration
MaxConnLifetime time.Duration
MaxConns int
MaxIdleConns int
}
ConnOpts are the options to create a connection
type ReadTableOpt ¶
type ReadTableOpt struct {
// Columns contains the (quoted) column of the table
Columns []string
// Match is a condition field to dump only certain amount data
Match string
// Sort the results
Sorts map[string]string
// Defines a limit of results to be fetched
Limit uint64
// Relationships defines an slice of relationship definitions
Relationships []*RelationshipOpt
}
ReadTableOpt represents the read table options
type Reader ¶
type Reader interface {
// GetStructure returns the SQL used to create the database tables
GetStructure() (string, error)
// GetTables returns a list of all databases tables
GetTables() ([]string, error)
// GetColumns return a list of all columns for a given table
GetColumns(string) ([]string, error)
// FormatColumn returns a escaped table.column string
FormatColumn(tableName string, columnName string) string
// ReadTable returns a channel with all database rows
ReadTable(string, chan<- database.Row, ReadTableOpt) error
// Close closes the reader resources and releases them.
Close() error
}
Reader provides an interface to access database stores.
Click to show internal directories.
Click to hide internal directories.