database

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContextSnapshotsCollection added in v1.2.2

func CreateContextSnapshotsCollection() *models.Collection

CreateContextSnapshotsCollection creates the context_snapshots collection

func CreateMemoryEntriesCollection added in v1.2.2

func CreateMemoryEntriesCollection() *models.Collection

CreateMemoryEntriesCollection creates the memory_entries collection

func CreateRelationshipsCollection added in v1.2.2

func CreateRelationshipsCollection() *models.Collection

CreateRelationshipsCollection creates the relationships collection

func CreateSessionsCollection added in v1.2.2

func CreateSessionsCollection() *models.Collection

CreateSessionsCollection creates the sessions collection with proper schema

func CreateTaskProgressCollection added in v1.2.2

func CreateTaskProgressCollection() *models.Collection

CreateTaskProgressCollection creates the task_progress collection

Types

type Database

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

Database represents the SQLite database connection and operations

func NewDatabase

func NewDatabase(dbPath string, logger *log.Logger) (*Database, error)

NewDatabase creates a new database connection and initializes the schema

func (*Database) BeginTransaction

func (d *Database) BeginTransaction() (*sql.Tx, error)

BeginTransaction starts a new transaction

func (*Database) Close

func (d *Database) Close() error

Close closes the database connection

func (*Database) ExecuteInTransaction

func (d *Database) ExecuteInTransaction(fn func(*sql.Tx) error) error

ExecuteInTransaction executes a function within a transaction

func (*Database) GetDB

func (d *Database) GetDB() *sql.DB

GetDB returns the underlying sql.DB for direct operations

func (*Database) GetStats

func (d *Database) GetStats() (map[string]interface{}, error)

GetStats returns database statistics

func (*Database) HealthCheck

func (d *Database) HealthCheck() error

HealthCheck performs a basic health check on the database

type SimplePocketBaseClient added in v1.2.2

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

SimplePocketBaseClient wraps PocketBase with minimal configuration

func NewSimplePocketBaseClient added in v1.2.2

func NewSimplePocketBaseClient(dataDir string) (*SimplePocketBaseClient, error)

NewSimplePocketBaseClient creates a new simple PocketBase client

func (*SimplePocketBaseClient) Bootstrap added in v1.2.2

func (c *SimplePocketBaseClient) Bootstrap(ctx context.Context) error

Bootstrap initializes the database with required collections

func (*SimplePocketBaseClient) Close added in v1.2.2

func (c *SimplePocketBaseClient) Close() error

Close gracefully shuts down the PocketBase client

func (*SimplePocketBaseClient) GetApp added in v1.2.2

GetApp returns the underlying PocketBase app instance

Jump to

Keyboard shortcuts

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