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, error)
- 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, error)
- func (qs *QuadStore) QuadDirection(in graph.Ref, d quad.Direction) (graph.Ref, error)
- 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, error)
- 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 ¶
func Register(name string, f Registration)
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(d QueryDialect) *Builder
func (*Builder) EscapeField ¶
func (*Builder) Placeholder ¶
type Field ¶
func (Field) NameOrAlias ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func (*Iterator) SubIterators ¶
type NullTime ¶
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 ¶
type Optimizer struct {
// contains filtered or unexported fields
}
func NewOptimizer ¶
func NewOptimizer() *Optimizer
func (*Optimizer) NoOffsetWithoutLimit ¶
func (opt *Optimizer) NoOffsetWithoutLimit()
func (*Optimizer) OptimizeShape ¶
func (*Optimizer) SetRegexpOp ¶
type Placeholder ¶
type Placeholder struct{}
func (Placeholder) SQL ¶
func (Placeholder) SQL(b *Builder) string
type QuadHashes ¶
type QuadStore ¶
type QuadStore struct {
// contains filtered or unexported fields
}
func (*QuadStore) ApplyDeltas ¶
func (*QuadStore) NewQuadWriter ¶
func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error)
func (*QuadStore) NodesAllIterator ¶
func (*QuadStore) OptimizeShape ¶
func (*QuadStore) QuadDirection ¶
func (*QuadStore) QuadIterator ¶
func (*QuadStore) QuadIteratorSize ¶
func (*QuadStore) QuadsAllIterator ¶
type QueryDialect ¶
type Registration ¶
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 CustomNullTime bool // driver doesn't support sql.NullTime 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 ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.