mssql

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(
	endpoint sqlconfig.Endpoint,
	user *sqlconfig.User,
	console sqlcmd.Console,
) *sqlcmd.Sqlcmd

Connect is used to connect to a SQL Server using the specified endpoint and user details. The console parameter is used to output messages during the connection process. The function returns a Sqlcmd instance that can be used to run SQL commands on the server.

func Initialize

func Initialize(
	errorHandler func(err error),
	traceHandler func(format string, a ...any),
	decryptHandler func(cipherText string, decrypt bool) (secret string))

func Query

func Query(s *sqlcmd.Sqlcmd, text string)

Query is helper function that allows running a given SQL query on a provided sqlcmd.Sqlcmd object. It takes the sqlcmd.Sqlcmd object and the query text as inputs, and runs the query using the Run method of the sqlcmd.Sqlcmd object. It sets the standard output and standard error to be the same as the current process, and returns the error if any occurred during the execution of the query.

Types

This section is empty.

Jump to

Keyboard shortcuts

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