Documentation ¶
Overview ¶
Collection schema and index management.
Collection and DB storage management.
Document management and index maintenance.
Query processor.
Index ¶
- Constants
- func Complement(subExprs interface{}, src *Col, result *map[int]struct{}) (err error)
- func EvalAllIDs(src *Col, result *map[int]struct{}) (err error)
- func EvalQuery(q interface{}, src *Col, result *map[int]struct{}) (err error)
- func EvalUnion(exprs []interface{}, src *Col, result *map[int]struct{}) (err error)
- func GetIn(doc interface{}, path []string) (ret []interface{})
- func IntRange(intFrom interface{}, expr map[string]interface{}, src *Col, ...) (err error)
- func Intersect(subExprs interface{}, src *Col, result *map[int]struct{}) (err error)
- func Lookup(lookupValue interface{}, expr map[string]interface{}, src *Col, ...) (err error)
- func PathExistence(hasPath interface{}, expr map[string]interface{}, src *Col, ...) (err error)
- func StrHash(str string) int
- type Col
- func (col *Col) AllIndexes() (ret [][]string)
- func (col *Col) ApproxDocCount() int
- func (col *Col) Delete(id int) error
- func (col *Col) ForEachDoc(fun func(id int, doc []byte) (moveOn bool))
- func (col *Col) ForEachDocInPage(page, total int, fun func(id int, doc []byte) bool)
- func (col *Col) Index(idxPath []string) (err error)
- func (col *Col) Insert(doc map[string]interface{}) (id int, err error)
- func (col *Col) InsertRecovery(id int, doc map[string]interface{}) (err error)
- func (col *Col) Read(id int) (doc map[string]interface{}, err error)
- func (col *Col) Unindex(idxPath []string) error
- func (col *Col) Update(id int, doc map[string]interface{}) error
- type DB
- func (db *DB) AllCols() (ret []string)
- func (db *DB) Close() error
- func (db *DB) Create(name string) error
- func (db *DB) Drop(name string) error
- func (db *DB) Dump(dest string) error
- func (db *DB) Rename(oldName, newName string) error
- func (db *DB) Scrub(name string) error
- func (db *DB) Truncate(name string) error
- func (db *DB) Use(name string) *Col
Constants ¶
const ( DOC_DATA_FILE = "dat_" // Prefix of partition collection data file name. DOC_LOOKUP_FILE = "id_" // Prefix of partition hash table (ID lookup) file name. INDEX_PATH_SEP = "!" // Separator between index keys in index directory name. )
const (
PART_NUM_FILE = "number_of_partitions" // DB-collection-partition-number-configuration file name
)
Variables ¶
This section is empty.
Functions ¶
func Complement ¶
Calculate complement of sub-query results.
func EvalAllIDs ¶
Put all document IDs into result.
func EvalQuery ¶
Main entrance to query processor - evaluate a query and put result into result map (as map keys).
func GetIn ¶
func GetIn(doc interface{}, path []string) (ret []interface{})
Resolve the attribute(s) in the document structure along the given path.
func IntRange ¶
func IntRange(intFrom interface{}, expr map[string]interface{}, src *Col, result *map[int]struct{}) (err error)
Look for indexed integer values within the specified integer range.
func Lookup ¶
func Lookup(lookupValue interface{}, expr map[string]interface{}, src *Col, result *map[int]struct{}) (err error)
Value equity check ("attribute == value") using hash lookup.
Types ¶
type Col ¶
type Col struct {
// contains filtered or unexported fields
}
Collection has data partitions and some index meta information.
func (*Col) ApproxDocCount ¶
Return approximate number of documents in the collection.
func (*Col) ForEachDoc ¶
Do fun for all documents in the collection.
func (*Col) ForEachDocInPage ¶
Divide the collection into roughly equally sized pages, and do fun on all documents in the specified page.
func (*Col) InsertRecovery ¶
Insert a document with the specified ID into the collection (incl. index). Does not place partition/schema lock.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
Database structures.