resultset

package
v1.1.0-beta.0...-2a72e7f Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CursorResultSet

type CursorResultSet interface {
	ResultSet

	GetRowIterator() RowIterator
}

CursorResultSet extends the `ResultSet` to provide the ability to store an iterator

func WrapWithLazyCursor

func WrapWithLazyCursor(rs ResultSet, capacity, maxChunkSize int) CursorResultSet

WrapWithLazyCursor wraps a ResultSet into a CursorResultSet

func WrapWithRowContainerCursor

func WrapWithRowContainerCursor(rs ResultSet, rowContainer chunk.RowContainerReader) CursorResultSet

WrapWithRowContainerCursor wraps a ResultSet into a CursorResultSet

type FetchNotifier

type FetchNotifier interface {
	// OnFetchReturned be called when COM_FETCH returns.
	// it will be used in server-side cursor.
	OnFetchReturned()
}

FetchNotifier represents notifier will be called in COM_FETCH.

type ResultSet

type ResultSet interface {
	Columns() []*column.Info
	NewChunk(chunk.Allocator) *chunk.Chunk
	Next(context.Context, *chunk.Chunk) error
	Close()
	// IsClosed checks whether the result set is closed.
	IsClosed() bool
	FieldTypes() []*types.FieldType
	SetPreparedStmt(stmt *core.PlanCacheStmt)
	Finish() error
	TryDetach() (ResultSet, bool, error)
}

ResultSet is the result set of an query.

func New

func New(recordSet sqlexec.RecordSet, preparedStmt *core.PlanCacheStmt) ResultSet

New creates a new result set

type RowIterator

type RowIterator interface {
	// Next returns the next Row.
	Next(context.Context) chunk.Row

	// Current returns the current Row.
	Current(context.Context) chunk.Row

	// End returns the invalid end Row.
	End() chunk.Row

	// Error returns none-nil error if anything wrong happens during the iteration.
	Error() error

	// Close closes the dumper
	Close()
}

RowIterator has similar method with `chunk.RowContainerReader`. The only difference is that it needs a `context.Context` for the `Next` and `Current` method.

Jump to

Keyboard shortcuts

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