query

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatNodeUpsert

func FormatNodeUpsert(graphTarget model.Graph, identityProperties []string) string

func FormatRelationshipPartitionUpsert

func FormatRelationshipPartitionUpsert(graphTarget model.Graph, identityProperties []string) string

Types

type Future

type Future[T any] struct {
	Value T
}

func NewFuture

func NewFuture[T any](value T) *Future[T]

type NodeUpdate

type NodeUpdate struct {
	IDFuture *Future[graph.ID]
	Node     *graph.Node
}

type NodeUpdateBatch

type NodeUpdateBatch struct {
	IdentityProperties []string
	Updates            map[string]*NodeUpdate
}

NodeUpdateBatch

TODO: See note below

Some assumptions were made here regarding identity kind matching since this data model does not directly require the kind of a node to enforce a constraint

func NewNodeUpdateBatch

func NewNodeUpdateBatch() *NodeUpdateBatch

func ValidateNodeUpdateByBatch

func ValidateNodeUpdateByBatch(updates []graph.NodeUpdate) (*NodeUpdateBatch, error)

func (*NodeUpdateBatch) Add

func (s *NodeUpdateBatch) Add(update graph.NodeUpdate) (*Future[graph.ID], error)

type Query

type Query struct {
	// contains filtered or unexported fields
}

func On

func On(tx graph.Transaction) Query

func (Query) AssertGraph

func (s Query) AssertGraph(schema graph.Graph, definition model.Graph) (model.Graph, error)

func (Query) CreateGraph

func (s Query) CreateGraph(schema graph.Graph) (model.Graph, error)

func (Query) CreatePartitionTable

func (s Query) CreatePartitionTable(name, parent string, graphID int32) (model.GraphPartition, error)

func (Query) CreatePropertyConstraint

func (s Query) CreatePropertyConstraint(indexName, tableName, fieldName string, indexType graph.IndexType) error

func (Query) CreatePropertyIndex

func (s Query) CreatePropertyIndex(indexName, tableName, fieldName string, indexType graph.IndexType) error

func (Query) CreateSchema

func (s Query) CreateSchema() error

func (Query) DropConstraint

func (s Query) DropConstraint(constraintName string) error

func (Query) DropIndex

func (s Query) DropIndex(indexName string) error

func (Query) DropSchema

func (s Query) DropSchema() error

func (Query) InsertOrGetKind

func (s Query) InsertOrGetKind(kind graph.Kind) (int16, error)

func (Query) SelectGraphByName

func (s Query) SelectGraphByName(name string) (model.Graph, error)

func (Query) SelectGraphs

func (s Query) SelectGraphs() (map[string]model.Graph, error)

func (Query) SelectKindID

func (s Query) SelectKindID(kind graph.Kind) (int16, error)

func (Query) SelectKinds

func (s Query) SelectKinds() (map[graph.Kind]int16, error)

func (Query) SelectTableIndexDefinitions

func (s Query) SelectTableIndexDefinitions(tableName string) ([]string, error)

type RelationshipUpdate

type RelationshipUpdate struct {
	StartID      *Future[graph.ID]
	EndID        *Future[graph.ID]
	Relationship *graph.Relationship
}

type RelationshipUpdateBatch

type RelationshipUpdateBatch struct {
	NodeUpdates        *NodeUpdateBatch
	IdentityProperties []string
	Updates            map[string]*RelationshipUpdate
}

func NewRelationshipUpdateBatch

func NewRelationshipUpdateBatch() *RelationshipUpdateBatch

func ValidateRelationshipUpdateByBatch

func ValidateRelationshipUpdateByBatch(updates []graph.RelationshipUpdate) (*RelationshipUpdateBatch, error)

func (*RelationshipUpdateBatch) Add

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL