adb_mssql

package module
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADAPTERTYPE_MSSQL                 aconns.AdapterType = "mssql"
	MSSQL_DEFAULT_PORT                                   = 1433
	MSSQL_CONNECTION_TIMEOUT                             = 30
	MSSQL_ENCRYPT_FALSE                                  = "false"
	MSSQL_TRUSTSERVERCERTIFICATE_TRUE                    = "true"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ADBMSSql

type ADBMSSql struct {
	aconns.ADBAdapterBase

	ConnectionTimeout      int    `json:"connectionTimeout,omitempty"`
	Encrypt                string `json:"encrypt,omitempty"`
	TrustServerCertificate string `json:"trustServerCertificate,omitempty"`
	// contains filtered or unexported fields
}

ADBMSSql represents an MSSQL database adapter.

func (*ADBMSSql) CloseConnection

func (cn *ADBMSSql) CloseConnection() error

CloseConnection closes the MSSQL connection.

func (*ADBMSSql) DB

func (cn *ADBMSSql) DB() *bun.DB

DB returns the bun.DB instance.

func (*ADBMSSql) GetAddress

func (cn *ADBMSSql) GetAddress() string

GetAddress returns the address of the MSSQL server.

func (*ADBMSSql) GetConnectionTimeout

func (cn *ADBMSSql) GetConnectionTimeout() int

GetConnectionTimeout returns the connection timeout.

func (*ADBMSSql) GetEncrypt

func (cn *ADBMSSql) GetEncrypt() string

GetEncrypt returns the encryption setting.

func (*ADBMSSql) GetSandboxAdapter

func (cn *ADBMSSql) GetSandboxAdapter() (aconns.ISBAdapter, error)

GetSandboxAdapter returns a sandbox adapter for the MSSQL database. It ensures that the ADBMSSql instance and its SQLDB are properly initialized.

func (*ADBMSSql) OpenConnection

func (cn *ADBMSSql) OpenConnection() error

OpenConnection opens a connection to the MSSQL database.

func (*ADBMSSql) SQLDB

func (cn *ADBMSSql) SQLDB() *sql.DB

SQLDB returns the sql.DB instance.

func (*ADBMSSql) Test

func (cn *ADBMSSql) Test() (bool, aconns.TestStatus, error)

Test attempts to validate the ADBMSSql, open a connection if necessary, and test the connection.

func (*ADBMSSql) Validate

func (cn *ADBMSSql) Validate() error

Validate checks if the ADBMSSql object is valid.

type ADBMSSqls

type ADBMSSqls []*ADBMSSql

ADBMSSqls represents a slice of ADBMSSql pointers.

Jump to

Keyboard shortcuts

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