Documentation
¶
Index ¶
- func ExecTxQuery(query string, tx *sql.Tx, args ...interface{}) (string, error)
- func GetSQLServerConnection(hostName string) (*sql.DB, error)
- func InitConnection(connectionDetails SQLServerConfig) (*sql.DB, error)
- func InitUsingJSON(configs []SQLServerConfig) error
- func SelectTxQuery(query string, tx *sql.Tx, args ...interface{}) (*gjson.Result, error)
- type SQLParameters
- type SQLServerConfig
- type SQLServerDAO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecTxQuery ¶
ExecTxQuery - ExecTxQuery
func GetSQLServerConnection ¶
GetSQLServerConnection returns connection by hostname
func InitConnection ¶
func InitConnection(connectionDetails SQLServerConfig) (*sql.DB, error)
InitConnection - InitConnection
func InitUsingJSON ¶
func InitUsingJSON(configs []SQLServerConfig) error
InitUsingJSON initializes sqlserver Connections for give JSON data
Types ¶
type SQLParameters ¶ added in v1.2.2
type SQLServerConfig ¶
type SQLServerConfig struct {
HostName string `json:"hostName"`
Server string `json:"server"`
Port int `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
Database string `json:"database"`
IsDefault bool `json:"isDefault"`
MaxIdleConns int `json:"maxIdleConns" `
MaxOpenConns int `json:"maxOpenConns"`
ConnMaxLifetime time.Duration `json:"connMaxLifetime" `
IsDisabled bool `json:"isDisabled" `
SQLParameters []SQLParameters `json:"sqlParameters"`
}
SQLServerConfig
type SQLServerDAO ¶
type SQLServerDAO struct {
HostName string
}
SQLServerDAO
func GetSQLServerDAO ¶
func GetSQLServerDAO() *SQLServerDAO
GetSQLServerDAO returns SQLServer DAO instance with default host
func GetSQLServerDAOWithHost ¶
func GetSQLServerDAOWithHost(hostName string) *SQLServerDAO
GetSQLServerDAOWithHost returns SQLServer DAO instance with provided host
func (*SQLServerDAO) ExecQuery ¶
func (ss *SQLServerDAO) ExecQuery(query string, args ...interface{}) (string, error)
ExecQuery to execute query
func (*SQLServerDAO) SelectQuery ¶
func (ss *SQLServerDAO) SelectQuery(query string, args ...interface{}) (*gjson.Result, error)
SelectQuery - SelectQuery
Click to show internal directories.
Click to hide internal directories.