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)
- func SelectTxQuery(query string, tx *sql.Tx, args ...interface{}) (*gjson.Result, error)
- 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)
InitUsingJSON initializes sqlserver Connections for give JSON data
Types ¶
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" ` }
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
Click to show internal directories.
Click to hide internal directories.