generic

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SqlEngine

type SqlEngine interface {
	// GetConnection return the sql.DB connection
	GetConnection() *sql.DB

	// GetStructure returns the SQL used to create the database tables
	GetStructure() (string, error)

	// GetTables return a list of all database tables
	GetTables() ([]string, error)

	// GetColumns return a list of all columns for a given table
	GetColumns(string) ([]string, error)

	// QuoteIdentifier returns a quoted instance of a identifier (table, column etc.)
	QuoteIdentifier(string) string

	// Close closes the connection and other resources and releases them.
	Close() error
}

sqlReader is a base class for sql related readers

type SqlReader

type SqlReader struct {
	SqlEngine
	// contains filtered or unexported fields
}

sqlReader is a base class for sql related readers

func NewSqlReader

func NewSqlReader(se SqlEngine, t time.Duration) *SqlReader

NewSqlReader creates a new sql reader

func (*SqlReader) FormatColumn

func (s *SqlReader) FormatColumn(tableName string, columnName string) string

FormatColumn returns a escaped table+column string

func (*SqlReader) GetColumns

func (s *SqlReader) GetColumns(tableName string) ([]string, error)

GetColumns returns the columns in the specified database table

func (*SqlReader) GetTables

func (s *SqlReader) GetTables() ([]string, error)

GetTables gets a list of all tables in the database

func (*SqlReader) ReadTable

func (s *SqlReader) ReadTable(tableName string, rowChan chan<- database.Row, opts reader.ReadTableOpt) error

ReadTable returns a list of all rows in a table

Jump to

Keyboard shortcuts

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