camlistore.org: camlistore.org/pkg/index/sqlindex Index | Files

package sqlindex

import "camlistore.org/pkg/index/sqlindex"

Package sqlindex implements the sorted.KeyValue interface using an *sql.DB.

Index

Package Files

sqlindex.go

type Storage Uses

type Storage struct {
    DB  *sql.DB

    // SetFunc is an optional func to use when REPLACE INTO does not exist
    SetFunc      func(*sql.DB, string, string) error
    BatchSetFunc func(*sql.Tx, string, string) error

    // PlaceHolderFunc optionally replaces ? placeholders with the right ones for the rdbms
    // in use
    PlaceHolderFunc func(string) string

    // Serial determines whether a Go-level mutex protects DB from
    // concurrent access.  This isn't perfect and exists just for
    // SQLite, whose driver likes to return "the database is
    // locked" (camlistore.org/issue/114), so this keeps some
    // pressure off. But we still trust SQLite to deal with
    // concurrency in most cases.
    Serial bool
    // contains filtered or unexported fields
}

Storage implements the sorted.KeyValue interface using an *sql.DB.

func (*Storage) BeginBatch Uses

func (s *Storage) BeginBatch() sorted.BatchMutation

func (*Storage) Close Uses

func (s *Storage) Close() error

func (*Storage) CommitBatch Uses

func (s *Storage) CommitBatch(b sorted.BatchMutation) error

func (*Storage) Delete Uses

func (s *Storage) Delete(key string) error

func (*Storage) Find Uses

func (s *Storage) Find(start, end string) sorted.Iterator

func (*Storage) Get Uses

func (s *Storage) Get(key string) (value string, err error)

func (*Storage) Set Uses

func (s *Storage) Set(key, value string) error

Package sqlindex imports 7 packages (graph) and is imported by 27 packages. Updated 2018-01-19. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).