query

package
v0.2.7-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DBProtoVersion is the cassandra protocol version used by gophr.
	DBProtoVersion = 4
	// DBKeyspaceName is the name of the gophr cassandra keyspace.
	DBKeyspaceName = "gophr"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnConditionBuilder

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

ColumnConditionBuilder helps to buidl conditions.

func Column

func Column(column string) *ColumnConditionBuilder

Column creates a condition builder.

func (*ColumnConditionBuilder) Equals

func (cb *ColumnConditionBuilder) Equals(value interface{}) *Condition

Equals creates an equivalence condition.

type Condition

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

Condition is a query filter used in db queries.

type IndexConditionBuilder

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

IndexConditionBuilder helps to buidl conditions.

func Index

func Index(index string) *IndexConditionBuilder

Index creates a condition builder.

func (*IndexConditionBuilder) Query

func (cb *IndexConditionBuilder) Query(query string) *Condition

Query creates an index condition.

type InsertQueryBuilder

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

InsertQueryBuilder constructs an insert query.

func InsertInto

func InsertInto(table string) *InsertQueryBuilder

InsertInto starts constructing an insert query.

func (*InsertQueryBuilder) Create

func (qb *InsertQueryBuilder) Create(session *gocql.Session) *gocql.Query

Create serializes and creates the query.

func (*InsertQueryBuilder) Value

func (qb *InsertQueryBuilder) Value(column string, value interface{}) *InsertQueryBuilder

Value adds a value mapping to the insert query.

type KeyspaceQueryBuilder

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

KeyspaceQueryBuilder constructs an create keyspace query.

func CreateKeyspaceIfNotExists

func CreateKeyspaceIfNotExists() *KeyspaceQueryBuilder

CreateKeyspaceIfNotExists starts constructing a keyspace creation query.

func (*KeyspaceQueryBuilder) Create

func (qb *KeyspaceQueryBuilder) Create(session *gocql.Session) *gocql.Query

Create serializes and creates the query.

func (*KeyspaceQueryBuilder) WithDurableWrites

func (qb *KeyspaceQueryBuilder) WithDurableWrites(durableWrites bool) *KeyspaceQueryBuilder

WithDurableWrites specifies whether writes to the keyspace should be durable.

func (*KeyspaceQueryBuilder) WithReplication

func (qb *KeyspaceQueryBuilder) WithReplication(class string, factor int) *KeyspaceQueryBuilder

WithReplication describes the replication of the keyspace.

type SelectQueryBuilder

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

SelectQueryBuilder constructs a select query.

func Select

func Select(columns ...string) *SelectQueryBuilder

Select starts constructing a select query.

func (*SelectQueryBuilder) And

func (qb *SelectQueryBuilder) And(condition *Condition) *SelectQueryBuilder

And is an alias for SelectQueryBuilder.Where(condition).

func (*SelectQueryBuilder) Create

func (qb *SelectQueryBuilder) Create(session *gocql.Session) *gocql.Query

Create serializes and creates the query.

func (*SelectQueryBuilder) From

func (qb *SelectQueryBuilder) From(table string) *SelectQueryBuilder

From specifies the table in a select query.

func (*SelectQueryBuilder) Limit

func (qb *SelectQueryBuilder) Limit(limit int) *SelectQueryBuilder

Limit specifies the maximum number of results to fetch.

func (*SelectQueryBuilder) Where

func (qb *SelectQueryBuilder) Where(condition *Condition) *SelectQueryBuilder

Where adds a condition to which all of the selected rows should adhere.

type UpdateQueryBuilder

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

UpdateQueryBuilder constructs an insert query.

func Update

func Update(table string) *UpdateQueryBuilder

Update starts constructing an insert query.

func (*UpdateQueryBuilder) And

func (qb *UpdateQueryBuilder) And(condition *Condition) *UpdateQueryBuilder

And is an alias for UpdateQueryBuilder.Where(condition).

func (*UpdateQueryBuilder) Create

func (qb *UpdateQueryBuilder) Create(session *gocql.Session) *gocql.Query

Create serializes and creates the query.

func (*UpdateQueryBuilder) Increment

func (qb *UpdateQueryBuilder) Increment(column string, amount int) *UpdateQueryBuilder

Increment increases the value of a counter by a specified amount.

func (*UpdateQueryBuilder) Set

func (qb *UpdateQueryBuilder) Set(column string, value string) *UpdateQueryBuilder

Set adds a value assignment to the update query.

func (*UpdateQueryBuilder) Where

func (qb *UpdateQueryBuilder) Where(condition *Condition) *UpdateQueryBuilder

Where adds a condition to which all of the updated rows should adhere.

Jump to

Keyboard shortcuts

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