driver

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterx

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

Iterx is the implementation for IterxI. This allows iterating over the results from SELECT query.

func (*Iterx) Close

func (i *Iterx) Close() error

Close closes the iterator and returns any errors that happened during the query or the iteration.

func (*Iterx) Select

func (i *Iterx) Select(dest interface{}) error

Select returns the statement that was used to generate this query.

type IterxI

type IterxI interface {
	Close() error
	Select(dest interface{}) error
}

IterxI allows iterating over the results from SELECT query. This can also be used for paging the results.

func NewIterx

func NewIterx(q QueryI) IterxI

NewIterx returns a new Iterx Instance

type Query

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

Query is the query-handler implementation for database-session.

func (*Query) Exec

func (q *Query) Exec() error

Exec executes the query.

func (*Query) GetPageSize

func (q *Query) GetPageSize() uint

GetPageSize returns the current page-size

func (*Query) GoCqlQuery added in v1.1.1

func (q *Query) GoCqlQuery() *cql.Query

GoCqlQuery returns the embedded GoCql query.

func (*Query) Release

func (q *Query) Release()

Release releases the query. Released queries cannot be reused.

func (*Query) SetPageSize

func (q *Query) SetPageSize(n uint) QueryI

SetPageSize tells the iterator to fetch the result in pages of size n. This is useful for iterating over large result sets, but setting the page size too low might decrease the performance. This feature is only available in Cassandra 2 and onwards.

func (*Query) Statement

func (q *Query) Statement() string

Statement returns the statement that was used to generate this query.

type QueryI

type QueryI interface {
	GoCqlQuery() *cql.Query
	Exec() error
	GetPageSize() uint
	SetPageSize(n uint) QueryI
	Release()
	Statement() string
}

QueryI is the query-handler for database-session.

type Queryx

type Queryx struct {
	ColumnNames []string
	// contains filtered or unexported fields
}

Queryx is the implementation for QueryxI.

func (*Queryx) BindMap

func (q *Queryx) BindMap(arg map[string]interface{}) QueryxI

BindMap binds query named parameters using Map.

func (*Queryx) BindStruct

func (q *Queryx) BindStruct(arg interface{}) QueryxI

BindStruct binds query named parameters to values from arg using mapper. If value cannot be found an error is reported.

func (*Queryx) ExecRelease

func (q *Queryx) ExecRelease() error

ExecRelease executes and releases the query, a released query cannot be reused.

func (*Queryx) Query

func (q *Queryx) Query() QueryI

Query returns the embedded gocql.Query.

func (*Queryx) Statement

func (q *Queryx) Statement() string

Statement returns the statement that was used to generate this query.

type QueryxI

type QueryxI interface {
	BindMap(map[string]interface{}) QueryxI
	BindStruct(interface{}) QueryxI
	ExecRelease() error
	Query() QueryI
	Statement() string
}

QueryxI is a wrapper around gocql.Query which adds and gocqlx.Queryx struct binding capabilities.

func NewQueryx

func NewQueryx(q QueryI, names []string) QueryxI

NewQueryx returns a new Queryx instance

type Session

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

Session is the database-session implementation.

func NewSession

func NewSession(session *cql.Session) *Session

NewSession creates a new database-session.

func (*Session) Close

func (s *Session) Close()

Close closes the database-session.

func (*Session) GoCqlSession added in v1.1.1

func (s *Session) GoCqlSession() *cql.Session

GoCqlSession returns the original wrapped GoCql-Session object.

func (*Session) Query

func (s *Session) Query(stmt string, values ...interface{}) QueryI

Query prepates the specified prepared-statement with given column-name values.

func (*Session) SetPageSize

func (s *Session) SetPageSize(n uint)

SetPageSize sets the default page size for this session. A value <= 0 will disable paging. This setting can also be changed on a per-query basis.

type SessionI

type SessionI interface {
	Query(stmt string, values ...interface{}) QueryI
	GoCqlSession() *cql.Session
}

SessionI is the database connection-session.

Jump to

Keyboard shortcuts

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