tdsclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnHost      = "localhost"
	DefaultConnPort      = "4100"
	DefaultConnTransport = "tcp"

	// TDSRxQueueSize is a buffer length for TDS packages receiver.
	//
	// To prevent deadlocks, it should be enough to contain one TDS packet
	// parsed into response packages.
	//
	// OMNIbus server returns max 8192-bytes packets,
	// min response is RowResult with at least 2 bytes (int8 token and 1+ bytes for data).
	// The worst case is: 8192 / 2 = 4096, 4100 should be enough:)
	TDSRxQueueSize = 4100
)

Variables

View Source
var (

	// ErrConnectionInUse returned if caller tries to use Connection concurrently,
	// that is not possible with TDS protocol 'one-query-at-a-time' limitation:
	// OMNIbus server does not support multiplexing
	ErrConnectionInUse = errors.New("connection in use")
	// ErrQueryFailed means that 'transaction error' message has been received from the server
	ErrQueryFailed = errors.New("query failed")

	ErrTranNotCompleted = errors.New("transaction completed message did not found")
	ErrTranFailed       = errors.New("transaction failed")
)

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Exec

func (c *Connection) Exec(ctx context.Context, query models.Query) (rows models.RowSet, affectedRows int, err error)

type TDSConnector

type TDSConnector struct {
	AppLabel   string
	TimeoutSec uint
}

func (*TDSConnector) Connect

func (c *TDSConnector) Connect(
	ctx context.Context,
	addr db.Addr,
	credentials qc.Credentials,
) (conn db.ExecutorCloser, err error)

Jump to

Keyboard shortcuts

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