Documentation ¶
Index ¶
- Constants
- func ExtractCursorBufferSize(ctx context.Context) int32
- func ExtractSchema(ctx context.Context) string
- func ExtractTimeoutMillis(ctx context.Context) int64
- func LoggerConfig() *logger.Config
- func MakeConfigFromDSN(dsn string) (*client.Config, error)
- func SSLConfig() *cluster.SSLConfig
- func SerializationConfig() *serialization.Config
- func SetLoggerConfig(c *logger.Config) error
- func SetSSLConfig(c *cluster.SSLConfig) error
- func SetSerializationConfig(c *serialization.Config) error
- type Conn
- type Connector
- type Driver
- type ExecResult
- type QueryCursorBufferSizeKey
- type QueryResult
- type QuerySchemaKey
- type QueryTimeoutKey
- type SQLService
- func (s *SQLService) Execute(ctx context.Context, query string, params []driver.Value, ...) (interface{}, error)
- func (s *SQLService) ExecuteSQL(ctx context.Context, query string, params []driver.Value) (*ExecResult, error)
- func (s *SQLService) QuerySQL(ctx context.Context, query string, params []driver.Value) (*QueryResult, error)
- type Statement
- func (s Statement) Close() error
- func (s *Statement) Exec(args []driver.Value) (driver.Result, error)
- func (s *Statement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (s Statement) NumInput() int
- func (s Statement) Query(args []driver.Value) (driver.Rows, error)
- func (s *Statement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
Constants ¶
const ( DefaultCursorBufferSize int32 = 4096 DefaultTimeoutMillis int64 = -1 DefaultSchema = "" )
const ( ExpectedResultAny byte = 0 ExpectedResultRows byte = 1 ExpectedResultUpdateCount byte = 2 )
Variables ¶
This section is empty.
Functions ¶
func ExtractCursorBufferSize ¶
func ExtractSchema ¶
func ExtractTimeoutMillis ¶
func LoggerConfig ¶
LoggerConfig returns the current logger 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 ¶
SetLoggerConfig stores the logger config. It copies the configuration before storing.
func SetSSLConfig ¶
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 NewConnWithConfig ¶
func (*Conn) CheckNamedValue ¶
func (c *Conn) CheckNamedValue(v *driver.NamedValue) error
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func NewConnectorWithClient ¶
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 NewSQLService ¶
func NewSQLService(cm *cluster.ConnectionManager, ss *iserialization.Service, invoker *client.Invoker, lg *logger.LogAdaptor) *SQLService
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
}