...
Package connect
Overview ▹
Index ▹
func DescribeQuery ¶
func DescribeQuery(db dber.Execer, qry string) ([]Column, error)
DescribeQuery describes the columns in the qry string, using DBMS_SQL.PARSE + DBMS_SQL.DESCRIBE_COLUMNS2.
This can help using unknown-at-compile-time, a.k.a. dynamic queries.
func GetCfg ¶
func GetCfg(dsn string) (srvCfg *ora.SrvCfg, sesCfg *ora.SesCfg)
GetDSN returns a (command-line defined) connection string
func GetConnection ¶
func GetConnection(dsn string) (*sql.DB, error)
GetConnection returns a connection - using GetDSN if dsn is empty
func GetDSN ¶
func GetDSN(srvCfg *ora.SrvCfg, sesCfg *ora.SesCfg) string
func GetRawConnection ¶
func GetRawConnection(dsn string) (*ora.Ses, error)
GetRawConnection returns a raw (*ora.Ses) connection - using GetDSN if dsn is empty
func MapToSlice ¶
func MapToSlice(qry string, metParam func(string) interface{}) (string, []interface{})
MapToSlice modifies query for map (:paramname) to :%d placeholders + slice of params.
Calls metParam for each parameter met, and returns the slice of their results.
func SplitDSN ¶
func SplitDSN(dsn string) (username, password, sid string)
SplitDSN splits the username/password@sid string to its parts.
Copied from github.com/tgulacsi/go/orahlp/orahlp.go
type Column ¶
type Column struct { Schema, Name string Type, Length, Precision, Scale int Nullable bool CharsetID, CharsetForm int }
type Version ¶
type Version struct {
// major.maintenance.application-server.component-specific.platform-specific
Major, Maintenance, AppServer, Component, Platform int8
}
func GetVersion ¶
func GetVersion(db dber.Queryer) (Version, error)