sqlserver

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecTxQuery

func ExecTxQuery(query string, tx *sql.Tx, args ...interface{}) (string, error)

ExecTxQuery - ExecTxQuery

func GetSQLServerConnection

func GetSQLServerConnection(hostName string) (*sql.DB, error)

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

func SelectTxQuery

func SelectTxQuery(query string, tx *sql.Tx, args ...interface{}) (*gjson.Result, error)

SelectTxQuery - SelectTxQuery

Types

type SQLParameters added in v1.2.2

type SQLParameters struct {
	Key   string
	Value string
}

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

Jump to

Keyboard shortcuts

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