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) Iterate() iterator.Scanner
- func (it *Iterator) Lookup() iterator.Index
- func (it *Iterator) Optimize(ctx context.Context) (iterator.Shape, bool)
- func (it *Iterator) Stats(ctx context.Context) (iterator.Costs, error)
- func (it *Iterator) String() string
- func (it *Iterator) SubIterators() []iterator.Shape
- 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.Ref) quad.Value
- func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error)
- func (qs *QuadStore) NodesAllIterator() iterator.Shape
- func (qs *QuadStore) OptimizeShape(ctx context.Context, s shape.Shape) (shape.Shape, bool)
- func (qs *QuadStore) Quad(val graph.Ref) quad.Quad
- func (qs *QuadStore) QuadDirection(in graph.Ref, d quad.Direction) graph.Ref
- func (qs *QuadStore) QuadIterator(d quad.Direction, val graph.Ref) iterator.Shape
- func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Direction, val graph.Ref) (refs.Size, error)
- func (qs *QuadStore) QuadsAllIterator() iterator.Shape
- func (qs *QuadStore) Query(ctx context.Context, s Shape) (*sql.Rows, error)
- func (qs *QuadStore) QueryRow(ctx context.Context, s Shape) *sql.Row
- func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Stats, error)
- func (qs *QuadStore) ValueOf(s quad.Value) graph.Ref
- 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) iterator.Shape
- func (s Select) Clone() Select
- func (s Select) Columns() []string
- func (s Select) Optimize(ctx context.Context, 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 ¶
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) SubIterators ¶ 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()
func (*Optimizer) OptimizeShape ¶ added in v0.7.0
func (*Optimizer) SetRegexpOp ¶ added in v0.7.1
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) NewQuadWriter ¶ added in v0.7.8
func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error)
func (*QuadStore) NodesAllIterator ¶
func (*QuadStore) OptimizeShape ¶ added in v0.7.0
func (*QuadStore) QuadDirection ¶
func (*QuadStore) QuadIterator ¶
func (*QuadStore) QuadIteratorSize ¶ added in v0.7.8
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 // contains filtered or unexported fields }
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.