Documentation ¶
Index ¶
- type ActiveDBMS
- func (atvdbms *ActiveDBMS) Connections() (cns []string)
- func (atvdbms *ActiveDBMS) Dispose()
- func (atvdbms *ActiveDBMS) DriverName(alias string) (driver string)
- func (atvdbms *ActiveDBMS) Execute(a interface{}, excargs ...interface{}) (exctr *Executor)
- func (atvdbms *ActiveDBMS) Exists(alias string) (exists bool)
- func (atvdbms *ActiveDBMS) InOut(in interface{}, out io.Writer, ioargs ...interface{}) (err error)
- func (atvdbms *ActiveDBMS) Info(alias ...string) (info map[string]interface{})
- func (atvdbms *ActiveDBMS) Query(a interface{}, qryargs ...interface{}) (reader *Reader)
- func (atvdbms *ActiveDBMS) Register(alias string, driver string, datasource string, a ...interface{}) (registered bool)
- func (atvdbms *ActiveDBMS) Unregister(alias string) (unregistered bool)
- type CSVReader
- type ColumnType
- func (colType *ColumnType) DatabaseType() string
- func (colType *ColumnType) HasLength() bool
- func (colType *ColumnType) HasNullable() bool
- func (colType *ColumnType) HasPrecisionScale() bool
- func (colType *ColumnType) Length() int64
- func (colType *ColumnType) Name() string
- func (colType *ColumnType) Nullable() bool
- func (colType *ColumnType) Numeric() bool
- func (colType *ColumnType) Precision() int64
- func (colType *ColumnType) Scale() int64
- func (colType *ColumnType) Type() reflect.Type
- type ColumnTypeHandle
- type Connection
- func (cn *Connection) DataSource() (datasource string)
- func (cn *Connection) Dispose() (err error)
- func (cn *Connection) Driver() (driver string)
- func (cn *Connection) GblExecute(query interface{}, prms ...interface{}) (exctr *Executor, err error)
- func (cn *Connection) GblQuery(query interface{}, prms ...interface{}) (reader *Reader, err error)
- func (cn *Connection) InOut(in interface{}, out io.Writer, ioargs ...interface{}) (err error)
- func (cn *Connection) Info() (info map[string]interface{})
- func (cn *Connection) IsConnected() (connected bool)
- func (cn *Connection) IsRemote() bool
- func (cn *Connection) Ping() (status map[string]interface{})
- func (cn *Connection) SetMaxIdleConns(idlcons int)
- func (cn *Connection) SetMaxOpenConns(opencons int)
- type DBMS
- func (dbms *DBMS) ActiveDBMS(rntme active.Runtime, prmsfnc func() parameters.ParametersAPI) (atvdbms *ActiveDBMS)
- func (dbms *DBMS) Connection(alias string) (cn *Connection)
- func (dbms *DBMS) Connections() (cns []string)
- func (dbms *DBMS) DriverName(alias string) (driver string)
- func (dbms *DBMS) Execute(a interface{}, excargs ...interface{}) (exctr *Executor)
- func (dbms *DBMS) Exists(alias string) (exists bool, dbcn *Connection)
- func (dbms *DBMS) InOut(in interface{}, out io.Writer, ioargs ...interface{}) (err error)
- func (dbms *DBMS) InOutS(in interface{}, ioargs ...interface{}) (out string, err error)
- func (dbms *DBMS) Info(alias ...string) (info map[string]interface{})
- func (dbms *DBMS) Query(a interface{}, qryargs ...interface{}) (reader *Reader)
- func (dbms *DBMS) QueryJSON(query interface{}, prms ...interface{}) (reader *Reader)
- func (dbms *DBMS) Register(alias string, driver string, datasource string, a ...interface{}) (registered bool)
- func (dbms *DBMS) RegisterDriver(driver string, invokedbcall func(string, ...interface{}) (*sql.DB, error))
- func (dbms *DBMS) Unregister(alias string) (unregistered bool)
- type DBMSAPI
- type ExecError
- type Executor
- func (exctr *Executor) Close() (err error)
- func (exctr *Executor) Err() (err error)
- func (exctr *Executor) JSON() (s string, err error)
- func (exctr *Executor) JSONReader() (jsnrdr *JSONReader)
- func (exctr *Executor) Repeat(args ...interface{}) (err error)
- func (exctr *Executor) ToJSON(w io.Writer) (err error)
- type Field
- type JSONDataEntry
- type JSONEntry
- type JSONReader
- type RWSAPI
- type RWSReader
- func (rwsrdr *RWSReader) Close() (err error)
- func (rwsrdr *RWSReader) ColumnTypes() (coltypes []*ColumnType, err error)
- func (rwsrdr *RWSReader) Columns() (cls []string, err error)
- func (rwsrdr *RWSReader) Err() (err error)
- func (rwsrdr *RWSReader) Next() (nxt bool)
- func (rwsrdr *RWSReader) Scan(dest ...interface{}) (err error)
- type Reader
- func (rdr *Reader) CSV() (s string, err error)
- func (rdr *Reader) CSVReader(a ...interface{}) (csvrdr *CSVReader)
- func (rdr *Reader) Close() (err error)
- func (rdr *Reader) ColumnTypes() []*ColumnType
- func (rdr *Reader) Columns() []string
- func (rdr *Reader) DATAJSONFPrint(w io.Writer) (err error)
- func (rdr *Reader) DATAJSONFPrintln(w io.Writer) (err error)
- func (rdr *Reader) Data(cols ...string) (dspdata []interface{})
- func (rdr *Reader) DataMap() (datamap map[string]interface{})
- func (rdr *Reader) Field(name string) (val interface{})
- func (rdr *Reader) IsFirst() bool
- func (rdr *Reader) IsFocused() bool
- func (rdr *Reader) IsLast() bool
- func (rdr *Reader) IsMore() bool
- func (rdr *Reader) JSON() (s string, err error)
- func (rdr *Reader) JSONData(cols ...string) (s string, err error)
- func (rdr *Reader) JSONReader() (jsnrdr *JSONReader)
- func (rdr *Reader) Next() (next bool, err error)
- func (rdr *Reader) Repeat(a ...interface{}) (err error)
- func (rdr *Reader) ToCSV(w io.Writer, a ...interface{}) (err error)
- func (rdr *Reader) ToJSON(w io.Writer) (err error)
- func (rdr *Reader) ToJSONData(w io.Writer, cols ...string) (err error)
- type ReaderHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveDBMS ¶
type ActiveDBMS struct {
// contains filtered or unexported fields
}
func (*ActiveDBMS) Connections ¶
func (atvdbms *ActiveDBMS) Connections() (cns []string)
func (*ActiveDBMS) Dispose ¶
func (atvdbms *ActiveDBMS) Dispose()
func (*ActiveDBMS) DriverName ¶
func (atvdbms *ActiveDBMS) DriverName(alias string) (driver string)
func (*ActiveDBMS) Execute ¶
func (atvdbms *ActiveDBMS) Execute(a interface{}, excargs ...interface{}) (exctr *Executor)
func (*ActiveDBMS) Exists ¶
func (atvdbms *ActiveDBMS) Exists(alias string) (exists bool)
func (*ActiveDBMS) InOut ¶
func (atvdbms *ActiveDBMS) InOut(in interface{}, out io.Writer, ioargs ...interface{}) (err error)
func (*ActiveDBMS) Info ¶
func (atvdbms *ActiveDBMS) Info(alias ...string) (info map[string]interface{})
func (*ActiveDBMS) Query ¶
func (atvdbms *ActiveDBMS) Query(a interface{}, qryargs ...interface{}) (reader *Reader)
func (*ActiveDBMS) Register ¶
func (atvdbms *ActiveDBMS) Register(alias string, driver string, datasource string, a ...interface{}) (registered bool)
func (*ActiveDBMS) Unregister ¶
func (atvdbms *ActiveDBMS) Unregister(alias string) (unregistered bool)
type CSVReader ¶
type CSVReader struct { Headers bool ColDelim string RowDelim string IncludeEOF bool AltHeaders []string // contains filtered or unexported fields }
CSVReader -
func NewCSVReader ¶
NewCSVReader - over rdr*Reader
type ColumnType ¶
type ColumnType struct {
// contains filtered or unexported fields
}
ColumnType structure defining column definition
func (*ColumnType) DatabaseType ¶
func (colType *ColumnType) DatabaseType() string
DatabaseType ColumnType underlying db type as defined by driver of Connection
func (*ColumnType) HasLength ¶
func (colType *ColumnType) HasLength() bool
HasLength ColumnType content has Length definition
func (*ColumnType) HasNullable ¶
func (colType *ColumnType) HasNullable() bool
HasNullable ColumnType content has NULL able content
func (*ColumnType) HasPrecisionScale ¶
func (colType *ColumnType) HasPrecisionScale() bool
HasPrecisionScale ColumnType content has PrecisionScale
func (*ColumnType) Length ¶
func (colType *ColumnType) Length() int64
Length ColumnType content lenth must be used in conjunction with HasLength
func (*ColumnType) Nullable ¶
func (colType *ColumnType) Nullable() bool
Nullable ColumnType content is Nullable
func (*ColumnType) Numeric ¶
func (colType *ColumnType) Numeric() bool
Numeric ColumnType is Numeric() bool
func (*ColumnType) Precision ¶
func (colType *ColumnType) Precision() int64
Precision ColumnType numeric Precision. Used in conjunction with HasPrecisionScale
func (*ColumnType) Scale ¶
func (colType *ColumnType) Scale() int64
Scale ColumnType Scale. Used in conjunction with HasPrecisionScale
func (*ColumnType) Type ¶
func (colType *ColumnType) Type() reflect.Type
Type ColumnType reflect.Type as specified by golang sql/database
type ColumnTypeHandle ¶
type ColumnTypeHandle interface { Name() string Numeric() bool HasNullable() bool HasLength() bool HasPrecisionScale() bool Nullable() bool Length() int64 DatabaseType() string Precision() int64 Scale() int64 Type() reflect.Type }
ColumnTypeHandle interface defining column type api
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection - struct
func NewConnection ¶
func NewConnection(dbms *DBMS, driverName, dataSourceName string) (cn *Connection)
NewConnection - dbms,driver name and datasource name (cn-string)
func (*Connection) DataSource ¶
func (cn *Connection) DataSource() (datasource string)
func (*Connection) Dispose ¶
func (cn *Connection) Dispose() (err error)
func (*Connection) Driver ¶
func (cn *Connection) Driver() (driver string)
func (*Connection) GblExecute ¶
func (cn *Connection) GblExecute(query interface{}, prms ...interface{}) (exctr *Executor, err error)
GblExecute - public for query()*Executor
func (*Connection) GblQuery ¶
func (cn *Connection) GblQuery(query interface{}, prms ...interface{}) (reader *Reader, err error)
GblQuery - public for query() *Reader
func (*Connection) InOut ¶
func (cn *Connection) InOut(in interface{}, out io.Writer, ioargs ...interface{}) (err error)
InOut - OO{ in interface{} -> out io.Writer } loop till no input
func (*Connection) Info ¶
func (cn *Connection) Info() (info map[string]interface{})
func (*Connection) IsConnected ¶
func (cn *Connection) IsConnected() (connected bool)
func (*Connection) IsRemote ¶
func (cn *Connection) IsRemote() bool
func (*Connection) Ping ¶
func (cn *Connection) Ping() (status map[string]interface{})
func (*Connection) SetMaxIdleConns ¶
func (cn *Connection) SetMaxIdleConns(idlcons int)
func (*Connection) SetMaxOpenConns ¶
func (cn *Connection) SetMaxOpenConns(opencons int)
type DBMS ¶
type DBMS struct {
// contains filtered or unexported fields
}
DBMS - struct
func (*DBMS) ActiveDBMS ¶
func (dbms *DBMS) ActiveDBMS(rntme active.Runtime, prmsfnc func() parameters.ParametersAPI) (atvdbms *ActiveDBMS)
ActiveDBMS return registered connections
func (*DBMS) Connection ¶
func (dbms *DBMS) Connection(alias string) (cn *Connection)
Connection return registered connections
func (*DBMS) Connections ¶
Connections return list of registered connection aliases
func (*DBMS) DriverName ¶
func (*DBMS) Execute ¶
ExecuteSettings - map[string]interface{} settings wrapper for Execute settings : alias - cn alias query - statement args - [] slice of arguments success - func(r) event when ready error - func(error) event when encountering an error finalize - func() final wrapup event repeatable - true keep underlying stmnt open and allows for repeating query script - script handle
func (*DBMS) Exists ¶
func (dbms *DBMS) Exists(alias string) (exists bool, dbcn *Connection)
Exists - alias exist <= exist[true], dbcn[*Connection]
func (*DBMS) Query ¶
Query - map[string]interface{} settings wrapper for Query settings : alias - cn alias query - statement args - [] slice of arguments success - func(r) event when ready error - func(error) event when encountering an error finalize - func() final wrapup event repeatable - true keep underlying stmnt open and allows for repeating query script - script handle
func (*DBMS) Register ¶
func (dbms *DBMS) Register(alias string, driver string, datasource string, a ...interface{}) (registered bool)
Register - new connection alias, driverName, dataSourceName
func (*DBMS) RegisterDriver ¶
func (dbms *DBMS) RegisterDriver(driver string, invokedbcall func(string, ...interface{}) (*sql.DB, error))
RegisterDriver - register driver name for invokable db call
func (*DBMS) Unregister ¶
Unegister connection aliase
type DBMSAPI ¶
type DBMSAPI interface { Connections() (cns []string) Unregister(alias string) (unregistered bool) Register(alias string, driver string, datasource string, a ...interface{}) (registered bool) Exists(alias string) (exists bool) Info(alias ...string) map[string]interface{} Query(a interface{}, qryargs ...interface{}) (reader *Reader) Execute(a interface{}, excargs ...interface{}) (exctr *Executor) InOut(in interface{}, out io.Writer, ioargs ...interface{}) (err error) DriverName(alias string) string }
type ExecError ¶
type ExecError struct {
// contains filtered or unexported fields
}
ExecError - struct
type Executor ¶
type Executor struct { Stmnt string OnSuccess interface{} OnError interface{} OnFinalize interface{} OnClose func(*Executor) // contains filtered or unexported fields }
Executor - struct
func (*Executor) JSONReader ¶
func (exctr *Executor) JSONReader() (jsnrdr *JSONReader)
JSONReader return *JSONReader
type JSONDataEntry ¶
type JSONDataEntry interface {
JSON() string
}
type JSONReader ¶
type JSONReader struct {
// contains filtered or unexported fields
}
JSONReader - struct
func NewJSONReader ¶
func NewJSONReader(rdr *Reader, exctr *Executor, err error) (jsnr *JSONReader)
NewJSONReader - over rdr*Reader or exctr*Executor
type RWSAPI ¶
type RWSAPI interface { Err() error Close() error Next() bool Scan(dest ...interface{}) error ColumnTypes() ([]*ColumnType, error) Columns() ([]string, error) }
RWSAPI - interface
type RWSReader ¶
type RWSReader struct {
// contains filtered or unexported fields
}
func (*RWSReader) ColumnTypes ¶
func (rwsrdr *RWSReader) ColumnTypes() (coltypes []*ColumnType, err error)
type Reader ¶
type Reader struct { *Executor OnColumns interface{} OnRow interface{} OnValidData interface{} OnClose func(*Reader) // contains filtered or unexported fields }
Reader - struct
func (*Reader) Close ¶
Close the Reader as well as the underlying Executor related to this Reader After this action the Reader is 'empty' or cleaned up in a golang world
func (*Reader) ColumnTypes ¶
func (rdr *Reader) ColumnTypes() []*ColumnType
ColumnTypes return Column types in form of a slice, 'array', of []*ColumnType values
func (*Reader) Data ¶
Data return Displayable data in the form of a slice, 'array', of interface{} values
func (*Reader) DataMap ¶
DataMap return Displayable data in the form of a map[string]interface{} column and values
func (*Reader) JSONReader ¶
func (rdr *Reader) JSONReader() (jsnrdr *JSONReader)
JSONReader return *JSONReader
func (*Reader) Next ¶
Next return true if able to move focus of Reader to the next underlying record or false if the end is reached
func (*Reader) Repeat ¶
Repeat - repeat last query by repopulating parameters but dont regenerate last statement