cql

package
v0.0.0-...-276be26 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CQL_KEY               = "cql"
	CQL_DEFAULT_VALUE_KEY = "default.cql"
	CQL_BEFORE_KEY        = "before"
	CQL_ENC_BCRYPT        = "bcrypt"
)

Variables

This section is empty.

Functions

func New

func New(configItem *dbi.ConfigItem) (backend dbi.DbBackend)

Types

type CassadraModel

type CassadraModel struct {
}

type Cassandra

type Cassandra struct {
	C *gocql.ClusterConfig
}

func (*Cassandra) CloseAll

func (s *Cassandra) CloseAll()

func (*Cassandra) Open

func (s *Cassandra) Open() (session dbi.DbSession)

type CassandraCRUD

type CassandraCRUD struct {
	TableName  string
	PrimaryKey []string
	Model      dbi.DbModel
	Session    *CassandraSession
}

func (*CassandraCRUD) BindQuery

func (s *CassandraCRUD) BindQuery(q *gocql.Query) Scanner

func (*CassandraCRUD) Delete

func (s *CassandraCRUD) Delete() bool

func (*CassandraCRUD) DeleteBy

func (s *CassandraCRUD) DeleteBy(conditions string, params ...interface{}) bool

func (*CassandraCRUD) DeleteWith

func (s *CassandraCRUD) DeleteWith(conditionFields ...string) bool

func (*CassandraCRUD) Exists

func (s *CassandraCRUD) Exists() bool

func (*CassandraCRUD) ExistsBy

func (s *CassandraCRUD) ExistsBy(conditions string, params ...interface{}) bool

func (*CassandraCRUD) ExistsWith

func (s *CassandraCRUD) ExistsWith(conditionFields ...string) bool

func (*CassandraCRUD) Get

func (s *CassandraCRUD) Get() (err error)

func (*CassandraCRUD) GetOne

func (s *CassandraCRUD) GetOne(conditions string, params ...interface{}) bool

func (*CassandraCRUD) Insert

func (s *CassandraCRUD) Insert() (rows int, err error)

func (*CassandraCRUD) InsertOrUpdate

func (s *CassandraCRUD) InsertOrUpdate(conditions ...string) bool

func (*CassandraCRUD) Query

func (s *CassandraCRUD) Query(results *[]interface{}, conditions string, params ...interface{}) *[]interface{}

func (*CassandraCRUD) Update

func (s *CassandraCRUD) Update() (rows int, err error)

func (*CassandraCRUD) UpdateWith

func (s *CassandraCRUD) UpdateWith(conditionFields ...string) bool

type CassandraSession

type CassandraSession struct {
	Instance *gocql.Session
}

func (*CassandraSession) Close

func (s *CassandraSession) Close()

func (*CassandraSession) GetCRUD

func (s *CassandraSession) GetCRUD(model dbi.DbModel, tableName string, pkColumns ...string) (crud dbi.DbCRUD)

type Scanner

type Scanner interface {
	Scan(target interface{}) error
}

TODO 这个Scanner在反射uuid时遇到问题,暂时未能完成

type XqlScanner

type XqlScanner struct {
	Query *gocql.Query
}

func (*XqlScanner) Scan

func (b *XqlScanner) Scan(target interface{}) error

Jump to

Keyboard shortcuts

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