Documentation
¶
Index ¶
- type Result
- func (r *Result) Close() error
- func (r *Result) Err() error
- func (r *Result) HasNext() bool
- func (r *Result) IsRowSet() bool
- func (r *Result) Iterator() (sql.RowsIterator, error)
- func (r *Result) Next() (sql.Row, error)
- func (r *Result) RowMetadata() (sql.RowMetadata, error)
- func (r *Result) UpdateCount() int64
- type Row
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result implements sql.Result and sql.RowsIterator. Depending on the statement type it represents a stream of rows or an update count. It is not concurrency-safe except the Close and Iterator method.
func (*Result) Close ¶
Close notifies the member to release resources for the corresponding query for results that represents a stream of rows. It can be safely called more than once, and it is concurrency-safe. If result represents an update count, it has no effect.
func (*Result) Err ¶
Err returns the error, if any, that was encountered during iteration. Err may be called after an explicit or implicit Close.
func (*Result) HasNext ¶
HasNext prepares the next result row for reading via Next method. It returns true on success, or false if there is no next result row or an error happened while preparing it.
func (*Result) IsRowSet ¶
IsRowSet returns whether this result has rows to iterate using the HasNext method.
func (*Result) Next ¶
Next returns the currentRow. Every call to Next, even the first one, must be preceded by a call to HasNext.
func (*Result) RowMetadata ¶
func (r *Result) RowMetadata() (sql.RowMetadata, error)
RowMetadata returns metadata information about rows. An error is returned if result represents an update count.
func (*Result) UpdateCount ¶
UpdateCount returns the number of rows updated by the statement or -1 if this result is a row set. In case the result doesn't contain rows but the update count isn't applicable or known, 0 is returned.
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row represents an SQL result row.
func (Row) Get ¶
Get returns the value of the column by index. If index is out of range, an error is returned.
func (Row) GetByColumnName ¶
GetByColumnName returns the value of the column by name. If columns does not exist, an error is returned.
func (Row) Metadata ¶
func (r Row) Metadata() sql.RowMetadata
Metadata returns the metadata information about the row.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(cm *cluster.ConnectionManager, ss *iserialization.Service, iv *client.Invoker, l *logger.LogAdaptor) Service
func (Service) Execute ¶
func (s Service) Execute(ctx context.Context, query string, params ...interface{}) (sql.Result, error)
Execute is a convenient method to execute a distributed query with the given parameter values. You may define parameter placeholders in the query with the "?" character. For every placeholder, a value must be provided.