Documentation ¶
Index ¶
- Constants
- Variables
- func Init(typ string, addr string, options graph.Options) error
- func New(typ string, addr string, options graph.Options) (graph.QuadStore, error)
- func Register(name string, f Registration)
- type BoolVal
- type Builder
- type CmpOp
- type Expr
- type Field
- type FieldName
- type FloatVal
- type IntVal
- type Iterator
- func (it *Iterator) Clone() graph.Iterator
- func (it *Iterator) Close() error
- func (it *Iterator) Contains(ctx context.Context, v graph.Value) bool
- func (it *Iterator) Err() error
- func (it *Iterator) Next(ctx context.Context) bool
- func (it *Iterator) NextPath(ctx context.Context) bool
- func (it *Iterator) Optimize() (graph.Iterator, bool)
- func (it *Iterator) Reset()
- func (it *Iterator) Result() graph.Value
- func (it *Iterator) Size() (int64, bool)
- func (it *Iterator) Stats() graph.IteratorStats
- func (it *Iterator) String() string
- func (it *Iterator) SubIterators() []graph.Iterator
- func (it *Iterator) TagResults(m map[string]graph.Value)
- func (it *Iterator) Tagger() *graph.Tagger
- func (it *Iterator) Type() graph.Type
- func (it *Iterator) UID() uint64
- type NodeHash
- type NullTime
- type Optimizer
- type Placeholder
- type QuadHashes
- type QuadStore
- func (qs *QuadStore) ApplyDeltas(in []graph.Delta, opts graph.IgnoreOpts) error
- func (qs *QuadStore) Close() error
- func (qs *QuadStore) NameOf(v graph.Value) quad.Value
- func (qs *QuadStore) NewIterator(s Select) *Iterator
- func (qs *QuadStore) NodesAllIterator() graph.Iterator
- func (qs *QuadStore) OptimizeIterator(it graph.Iterator) (graph.Iterator, bool)
- func (qs *QuadStore) OptimizeShape(s shape.Shape) (shape.Shape, bool)
- func (qs *QuadStore) Quad(val graph.Value) quad.Quad
- func (qs *QuadStore) QuadDirection(in graph.Value, d quad.Direction) graph.Value
- func (qs *QuadStore) QuadIterator(d quad.Direction, val graph.Value) graph.Iterator
- func (qs *QuadStore) QuadsAllIterator() graph.Iterator
- func (qs *QuadStore) Query(ctx context.Context, s Shape) (*sql.Rows, error)
- func (qs *QuadStore) Size() int64
- func (qs *QuadStore) ValueOf(s quad.Value) graph.Value
- type QueryDialect
- type Registration
- type Select
- func (s *Select) AppendParam(o Value) Expr
- func (s Select) Args() []Value
- func (s Select) BuildIterator(qs graph.QuadStore) graph.Iterator
- func (s Select) Clone() Select
- func (s Select) Columns() []string
- func (s Select) Optimize(r shape.Optimizer) (shape.Shape, bool)
- func (s Select) SQL(b *Builder) string
- func (s *Select) WhereEq(tbl, field string, v Value)
- type Shape
- type Source
- type StringVal
- type Subquery
- type Table
- type TimeVal
- type Value
- type ValueType
- type Where
Constants ¶
View Source
const ( OpEqual = CmpOp("=") OpGT = CmpOp(">") OpGTE = CmpOp(">=") OpLT = CmpOp("<") OpLTE = CmpOp("<=") OpIsNull = CmpOp("IS NULL") OpIsTrue = CmpOp("IS true") )
View Source
const QuadStoreType = "sql"
Type string for generic sql QuadStore.
Deprecated: use specific types from sub-packages.
Variables ¶
View Source
var DefaultDialect = QueryDialect{ FieldQuote: func(s string) string { return strconv.Quote(s) }, Placeholder: func(_ int) string { return "?" }, }
Functions ¶
func Register ¶ added in v0.7.0
func Register(name string, f Registration)
Types ¶
type Builder ¶ added in v0.7.0
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶ added in v0.7.0
func NewBuilder(d QueryDialect) *Builder
func (*Builder) EscapeField ¶ added in v0.7.0
func (*Builder) Placeholder ¶ added in v0.7.0
type Field ¶ added in v0.7.0
func (Field) NameOrAlias ¶ added in v0.7.0
type Iterator ¶ added in v0.7.0
type Iterator struct {
// contains filtered or unexported fields
}
func (*Iterator) Stats ¶ added in v0.7.0
func (it *Iterator) Stats() graph.IteratorStats
func (*Iterator) SubIterators ¶ added in v0.7.0
func (*Iterator) TagResults ¶ added in v0.7.0
type NullTime ¶ added in v0.6.1
NullTime represents a time.Time that may be null. NullTime implements the sql.Scanner interface so it can be used as a scan destination, similar to sql.NullString.
type Optimizer ¶ added in v0.7.0
type Optimizer struct {
// contains filtered or unexported fields
}
func NewOptimizer ¶ added in v0.7.0
func NewOptimizer() *Optimizer
func (*Optimizer) NoOffsetWithoutLimit ¶ added in v0.7.0
func (opt *Optimizer) NoOffsetWithoutLimit()
type Placeholder ¶ added in v0.7.0
type Placeholder struct{}
func (Placeholder) SQL ¶ added in v0.7.0
func (Placeholder) SQL(b *Builder) string
type QuadHashes ¶ added in v0.6.0
type QuadStore ¶
type QuadStore struct {
// contains filtered or unexported fields
}
func (*QuadStore) ApplyDeltas ¶
func (*QuadStore) NewIterator ¶ added in v0.7.0
func (*QuadStore) NodesAllIterator ¶
func (*QuadStore) OptimizeIterator ¶
func (*QuadStore) OptimizeShape ¶ added in v0.7.0
func (*QuadStore) QuadDirection ¶
func (*QuadStore) QuadIterator ¶
func (*QuadStore) QuadsAllIterator ¶
type QueryDialect ¶ added in v0.7.0
type Registration ¶ added in v0.7.0
type Registration struct { Driver string // sql driver to use on dial HashType string // type for hash fields BytesType string // type for binary fields TimeType string // type for datetime fields HorizonType string // type for horizon counter NodesTableExtra string // extra SQL to append to nodes table definition ConditionalIndexes bool // database supports conditional indexes FillFactor bool // database supports fill percent on indexes NoForeignKeys bool // database has no support for FKs QueryDialect NoOffsetWithoutLimit bool // SELECT ... OFFSET can be used only with LIMIT Error func(error) error // error conversion function Estimated func(table string) string // query that string that returns an estimated number of rows in table RunTx func(tx *sql.Tx, nodes []graphlog.NodeUpdate, quads []graphlog.QuadUpdate, opts graph.IgnoreOpts) error TxRetry func(tx *sql.Tx, stmts func() error) error NoSchemaChangesInTx bool }
type Select ¶ added in v0.7.0
type Select struct { Fields []Field From []Source Where []Where Params []Value Limit int64 Offset int64 }
Select is a simplified representation of SQL SELECT query.
func (*Select) AppendParam ¶ added in v0.7.0
func (Select) BuildIterator ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.