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
- 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) NewIterator(s Select) *Iterator
- func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error)
- func (qs *QuadStore) NodesAllIterator() graph.Iterator
- func (qs *QuadStore) OptimizeShape(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) graph.Iterator
- func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Direction, val graph.Ref) (graph.Size, error)
- func (qs *QuadStore) QuadsAllIterator() graph.Iterator
- 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) 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
func (*Iterator) AsShape ¶ added in v0.7.6
func (it *Iterator) AsShape() graph.IteratorShape
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) NewIterator ¶ added in v0.7.0
func (*QuadStore) NewQuadWriter ¶ added in v0.7.6
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.6
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.