Documentation
¶
Index ¶
- func InitializeBuckets(db *bbolt.DB) error
- func VerifyBucketsExist(db *bbolt.DB) error
- type DB
- func (db *DB) BulkInsertNodes(nodes []*types.Node) error
- func (db *DB) CheckChildrenExist(parentID, world string) (bool, error)
- func (db *DB) Close() error
- func (db *DB) CreateFolder(parentID, name string, depth int) (*types.Node, error)
- func (db *DB) CreateRootNode() error
- func (db *DB) DeleteAllNodes() error
- func (db *DB) DeleteNode(id string) error
- func (db *DB) GetChildrenByParentID(parentID, world string) ([]*types.Node, error)
- func (db *DB) GetNodeByID(id string) (*types.Node, error)
- func (db *DB) GetNodeByPath(path, world string) (*types.Node, error)
- func (db *DB) GetNodeCount(world string) (int, error)
- func (db *DB) GetParentAndChildren(parentID, world string) ([]*types.Node, error)
- func (db *DB) GetSecondaryTables() []string
- func (db *DB) GetStats() (*types.Stats, error)
- func (db *DB) GetTableInfo() ([]types.TableInfo, error)
- func (db *DB) InsertNode(node *types.Node) error
- func (db *DB) UpdateExistenceMap(id string, existenceMap map[string]bool) error
- func (db *DB) VerifyAndInitialize(dbFileExists bool, secondaryTables map[string]float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeBuckets ¶
InitializeBuckets creates all required buckets in the BoltDB database This replaces the SQL table creation logic
func VerifyBucketsExist ¶
VerifyBucketsExist checks if all required buckets exist in the database This replaces the SQL table existence checks
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps BoltDB connection and provides key-value CRUD operations
func (*DB) BulkInsertNodes ¶
BulkInsertNodes inserts multiple nodes in a single BoltDB transaction
func (*DB) CheckChildrenExist ¶
CheckChildrenExist checks if a parent has any children in a specific world
func (*DB) Close ¶
Close closes the database connection BoltDB is ACID compliant and automatically persists all changes
func (*DB) CreateFolder ¶
CreateFolder creates a new folder node
func (*DB) CreateRootNode ¶
CreateRootNode creates a single root node with existence in all worlds This function is idempotent - it will skip creating the node if it already exists
func (*DB) DeleteAllNodes ¶
DeleteAllNodes removes all nodes from the nodes bucket and all indexes (for Reset)
func (*DB) DeleteNode ¶
DeleteNode deletes a node from the nodes bucket and all indexes
func (*DB) GetChildrenByParentID ¶
GetChildrenByParentID retrieves all children of a parent node filtered by world
func (*DB) GetNodeByID ¶
GetNodeByID retrieves a node by its ID from the nodes bucket
func (*DB) GetNodeByPath ¶
GetNodeByPath retrieves a node by its path, optionally filtering by world
func (*DB) GetNodeCount ¶
GetNodeCount returns the total number of nodes in a specific world
func (*DB) GetParentAndChildren ¶
GetParentAndChildren retrieves parent and all its children in ONE optimized query This is the key performance optimization for ListChildren operations
func (*DB) GetSecondaryTables ¶
GetSecondaryTables returns the list of secondary world names
func (*DB) GetTableInfo ¶
GetTableInfo returns information about all worlds
func (*DB) InsertNode ¶
InsertNode inserts a new node into the nodes bucket and updates all indexes
func (*DB) UpdateExistenceMap ¶
UpdateExistenceMap updates the existence map for a node
func (*DB) VerifyAndInitialize ¶
VerifyAndInitialize performs comprehensive database verification and initialization It checks each stage and creates what's missing: A) Database file exists (checked before connection) B) Buckets exist C) Root node exists