driver

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCursorBufferSize int32 = 4096
	DefaultTimeoutMillis    int64 = -1
	DefaultSchema                 = ""
)
View Source
const (
	ExpectedResultAny         byte = 0
	ExpectedResultRows        byte = 1
	ExpectedResultUpdateCount byte = 2
)

Variables

This section is empty.

Functions

func ExtractCursorBufferSize

func ExtractCursorBufferSize(ctx context.Context) int32

func ExtractSchema

func ExtractSchema(ctx context.Context) string

func ExtractTimeoutMillis

func ExtractTimeoutMillis(ctx context.Context) int64

func LoggerConfig

func LoggerConfig() *logger.Config

LoggerConfig returns the current logger config. Note that it doesn't return a copy.

func MakeConfigFromDSN

func MakeConfigFromDSN(dsn string) (*client.Config, error)

func SSLConfig

func SSLConfig() *cluster.SSLConfig

SSLConfig returns the current SSL config. Note that it doesn't return a copy.

func SerializationConfig

func SerializationConfig() *serialization.Config

SerializationConfig returns the current serialization config. Note that it doesn't return a copy.

func SetLoggerConfig

func SetLoggerConfig(c *logger.Config) error

SetLoggerConfig stores the logger config. It copies the configuration before storing.

func SetSSLConfig

func SetSSLConfig(c *cluster.SSLConfig) error

SetSSLConfig stores the SSL config. It copies the configuration before storing.

func SetSerializationConfig

func SetSerializationConfig(c *serialization.Config) error

SetSerializationConfig stores the serialization config. It copies the configuration before storing.

Types

type Conn

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

func NewConnWithClient

func NewConnWithClient(ic *client.Client) *Conn

func NewConnWithConfig

func NewConnWithConfig(ctx context.Context, config *client.Config) (*Conn, error)

func (Conn) Begin

func (c Conn) Begin() (driver.Tx, error)

func (*Conn) CheckNamedValue

func (c *Conn) CheckNamedValue(v *driver.NamedValue) error

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Prepare

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

type Connector

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

func NewConnector

func NewConnector(config *client.Config) *Connector

func NewConnectorWithClient

func NewConnectorWithClient(ic *client.Client, keepClient bool) *Connector

func (*Connector) Close

func (c *Connector) Close() error

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context) (driver.Conn, error)

func (Connector) Driver

func (c Connector) Driver() driver.Driver

type Driver

type Driver struct{}

func (*Driver) Open

func (d *Driver) Open(name string) (driver.Conn, error)

func (*Driver) OpenConnector

func (d *Driver) OpenConnector(name string) (driver.Connector, error)

type ExecResult

type ExecResult struct {
	UpdateCount int64
}

ExecResult contains the result of an SQL query which doesn't return any rows.

func (ExecResult) LastInsertId

func (r ExecResult) LastInsertId() (int64, error)

LastInsertId always returns -1. It implements database/sql/Driver interface.

func (ExecResult) RowsAffected

func (r ExecResult) RowsAffected() (int64, error)

RowsAffected returned the number of affected rows. It implements database/sql/Driver interface.

type QueryCursorBufferSizeKey

type QueryCursorBufferSizeKey struct{}

type QueryResult

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

QueryResult contains the result of a query. Rows are loaded in batches on demand. QueryResult is not concurrency-safe, except for closing it.

func NewQueryResult

func NewQueryResult(ctx context.Context, qid itype.QueryID, md itype.RowMetadata, page itype.Page, ss *SQLService, conn *icluster.Connection, cbs int32, infiniteRows bool) (*QueryResult, error)

NewQueryResult creates a new QueryResult.

func (*QueryResult) Close

func (r *QueryResult) Close() error

Close notifies the member to release resources for the corresponding query. It can be safely called more than once and it is concurrency-safe. It implements database/sql/Rows interface.

func (*QueryResult) Columns

func (r *QueryResult) Columns() []string

Columns returns the column names for the rows in the query result. It implements database/sql/Rows interface.

func (*QueryResult) InfiniteRows added in v1.4.0

func (r *QueryResult) InfiniteRows() bool

func (*QueryResult) Len

func (r *QueryResult) Len() int

func (*QueryResult) Metadata

func (r *QueryResult) Metadata() sql.RowMetadata

func (*QueryResult) Next

func (r *QueryResult) Next(dest []driver.Value) error

Next requests the next batch of rows from the member. If there are no rows left, it returns io.EOF This method is not concurrency-safe. It implements database/sql/Rows interface. InvocationTimeout field of hazelcast.Config is respected for timeout.

type QuerySchemaKey

type QuerySchemaKey struct{}

type QueryTimeoutKey

type QueryTimeoutKey struct{}

type SQLService

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

func (*SQLService) Execute

func (s *SQLService) Execute(ctx context.Context, query string, params []driver.Value, resultType sql.ExpectedResultType) (interface{}, error)

func (*SQLService) ExecuteSQL

func (s *SQLService) ExecuteSQL(ctx context.Context, query string, params []driver.Value) (*ExecResult, error)

ExecuteSQL runs the given SQL query on the member-side. Placeholders in the query is replaced by params. A placeholder is the question mark (?) character. For each placeholder, a corresponding param should exist.

func (*SQLService) QuerySQL

func (s *SQLService) QuerySQL(ctx context.Context, query string, params []driver.Value) (*QueryResult, error)

QuerySQL runs the given SQL query on the member-side. Placeholders in the query is replaced by params. A placeholder is the question mark (?) character. For each placeholder, a corresponding parameter should exist.

type Statement

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

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)

Jump to

Keyboard shortcuts

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