connection

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToResult

func ToResult(result *types.SqlQueriesResponse) (driver.Result, error)

func ToRow

func ToRow(result *types.SqlQueriesResponse, con *Connection) (driver.Rows, error)

Types

type Connection

type Connection struct {
	Config *config.Config

	Ctx      context.Context
	IsClosed bool
	// contains filtered or unexported fields
}

func (*Connection) Begin

func (c *Connection) Begin() (driver.Tx, error)

func (*Connection) Close

func (c *Connection) Close() error

func (*Connection) Connect

func (c *Connection) Connect() error

func (*Connection) Exec

func (c *Connection) Exec(query string, args []driver.Value) (driver.Result, error)

func (*Connection) ExecContext

func (c *Connection) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)

func (*Connection) Login

func (c *Connection) Login(ctx context.Context) error

func (*Connection) Prepare

func (c *Connection) Prepare(query string) (driver.Stmt, error)

func (*Connection) PrepareContext

func (c *Connection) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)

func (*Connection) Query

func (c *Connection) Query(query string, args []driver.Value) (driver.Rows, error)

func (*Connection) QueryContext

func (c *Connection) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)

func (*Connection) Send

func (c *Connection) Send(ctx context.Context, request, response interface{}) error

func (*Connection) SimpleExec

func (c *Connection) SimpleExec(ctx context.Context, query string) (*types.SqlQueriesResponse, error)

type ImportStatement

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

func NewImportStatement

func NewImportStatement(query string, host string, port int) (*ImportStatement, error)

func (*ImportStatement) Close

func (i *ImportStatement) Close()

func (*ImportStatement) GetUpdatedQuery

func (i *ImportStatement) GetUpdatedQuery() string

func (*ImportStatement) UploadFiles

func (i *ImportStatement) UploadFiles(ctx context.Context) error

type QueryResults

type QueryResults struct {
	sync.Mutex // guards following
	// contains filtered or unexported fields
}

func (*QueryResults) Close

func (results *QueryResults) Close() error

func (*QueryResults) ColumnTypeDatabaseTypeName

func (results *QueryResults) ColumnTypeDatabaseTypeName(index int) string

func (*QueryResults) ColumnTypeLength

func (results *QueryResults) ColumnTypeLength(index int) (length int64, ok bool)

func (*QueryResults) ColumnTypeNullable

func (results *QueryResults) ColumnTypeNullable(index int) (nullable, ok bool)

func (*QueryResults) ColumnTypePrecisionScale

func (results *QueryResults) ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)

func (*QueryResults) ColumnTypeScanType

func (results *QueryResults) ColumnTypeScanType(index int) reflect.Type

func (*QueryResults) Columns

func (results *QueryResults) Columns() []string

func (*QueryResults) Next

func (results *QueryResults) Next(dest []driver.Value) error

type RowCount

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

func (*RowCount) LastInsertId

func (res *RowCount) LastInsertId() (int64, error)

func (*RowCount) RowsAffected

func (res *RowCount) RowsAffected() (int64, error)

type Statement

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

func NewStatement

func NewStatement(connection *Connection, response *types.CreatePreparedStatementResponse) *Statement

func (*Statement) Close

func (s *Statement) Close() error

func (*Statement) Exec

func (s *Statement) Exec(args []driver.Value) (driver.Result, error)

func (*Statement) ExecContext

func (s *Statement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)

func (*Statement) NumInput

func (s *Statement) NumInput() int

func (*Statement) Query

func (s *Statement) Query(args []driver.Value) (driver.Rows, error)

func (*Statement) QueryContext

func (s *Statement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)

type Transaction

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

func NewTransaction

func NewTransaction(connection *Connection) *Transaction

func (*Transaction) Commit

func (t *Transaction) Commit() error

func (*Transaction) Rollback

func (t *Transaction) Rollback() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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