Documentation ¶
Index ¶
- Constants
- Variables
- func AddNode(identifier string, node []byte, database ...string) (int64, error)
- func AddNodes(identifiers []string, nodes [][]byte, database ...string) (int64, error)
- func BulkConnectNodes(sources []string, targets []string, database ...string) (int64, error)
- func BulkConnectNodesWithProperties(sources []string, targets []string, properties []string, database ...string) (int64, error)
- func ConnectNodes(sourceId string, targetId string, database ...string) (int64, error)
- func ConnectNodesWithProperties(sourceId string, targetId string, properties []byte, database ...string) (int64, error)
- func FindNode(identifier string, database ...string) (string, error)
- func FindNodes(statement string, bindings []string, database ...string) ([]string, error)
- func GenerateSearchStatement(properties *SearchQuery) string
- func GenerateTraversal(properties *Traversal) string
- func GenerateWhereClause(properties *WhereClause) string
- func Initialize(database ...string)
- func RemoveNodes(identifiers []string, database ...string) bool
- func TraverseFrom(source string, traversal string, database ...string) ([]string, error)
- func TraverseFromTo(source string, target string, traversal string, database ...string) ([]string, error)
- func UpdateNodeBody(identifier string, body string, database ...string) error
- func UpsertNode(identifier string, body string, database ...string) error
- type EdgeData
- type EdgeSet
- type GraphData
- type NodeData
- type SearchQuery
- type Traversal
- type WhereClause
Constants ¶
View Source
const ( DeleteEdge = `DELETE FROM edges WHERE source = ? OR target = ? ` DeleteNode = `DELETE FROM nodes WHERE id = ? ` InsertEdge = `INSERT INTO edges VALUES(?, ?, json(?)) ` InsertNode = `INSERT INTO nodes VALUES(json(?)) ` Schema = `` /* 555-byte string literal not displayed */ SearchEdgesInbound = `SELECT * FROM edges WHERE source = ? ` SearchEdgesOutbound = `SELECT * FROM edges WHERE target = ? ` SearchEdges = `SELECT * FROM edges WHERE source = ? UNION SELECT * FROM edges WHERE target = ? ` UpdateNode = `UPDATE nodes SET body = json(?) WHERE id = ? ` SearchNodeTemplate = `` /* 214-byte string literal not displayed */ SearchWhereTemplate = `` /* 287-byte string literal not displayed */ TraverseTemplate = `` /* 583-byte string literal not displayed */ )
View Source
const ( SQLITE = "libsql" // WITH_FOREIGN_KEY_PRAGMA = "%s?_foreign_keys=true" ID_CONSTRAINT = "NOT NULL constraint failed: nodes.id" UNIQUE_ID_CONSTRAINT = "UNIQUE constraint failed: nodes.id" NO_ROWS_FOUND = "sql: no rows in result set" )
Variables ¶
View Source
var ( CLAUSE_TEMPLATE = template.Must(template.New("where").Parse(SearchWhereTemplate)) SEARCH_TEMPLATE = template.Must(template.New("search").Parse(SearchNodeTemplate)) TRAVERSE_TEMPLATE = template.Must(template.New("traverse").Parse(TraverseTemplate)) )
Functions ¶
func BulkConnectNodes ¶
func ConnectNodes ¶
func GenerateSearchStatement ¶
func GenerateSearchStatement(properties *SearchQuery) string
func GenerateTraversal ¶
func GenerateWhereClause ¶
func GenerateWhereClause(properties *WhereClause) string
func Initialize ¶
func Initialize(database ...string)
func RemoveNodes ¶
func TraverseFrom ¶
func TraverseFromTo ¶
Types ¶
type EdgeSet ¶
type EdgeSet struct {
// contains filtered or unexported fields
}
func NewEdgeSet ¶
func NewEdgeSet() *EdgeSet
type GraphData ¶
func TraverseWithBodiesFrom ¶
type SearchQuery ¶
Click to show internal directories.
Click to hide internal directories.