Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerLogger ¶
type BadgerLogger struct {
// contains filtered or unexported fields
}
BadgerLogger is a wrapper type to give our logger the expected interface
func NewBadgerLogger ¶
func NewBadgerLogger(logger *slog.Logger) *BadgerLogger
func (*BadgerLogger) Debugf ¶
func (b *BadgerLogger) Debugf(msg string, args ...any)
func (*BadgerLogger) Errorf ¶
func (b *BadgerLogger) Errorf(msg string, args ...any)
func (*BadgerLogger) Infof ¶
func (b *BadgerLogger) Infof(msg string, args ...any)
func (*BadgerLogger) Warningf ¶
func (b *BadgerLogger) Warningf(msg string, args ...any)
type BaseDatabase ¶
type BaseDatabase struct {
// contains filtered or unexported fields
}
func (*BaseDatabase) Blob ¶
func (b *BaseDatabase) Blob() *badger.DB
Blob returns the underling blob DB instance
func (*BaseDatabase) Close ¶
func (b *BaseDatabase) Close() error
Close cleans up the database connections
func (*BaseDatabase) Metadata ¶
func (b *BaseDatabase) Metadata() *gorm.DB
Metadata returns the underlying metadata DB instance
func (*BaseDatabase) Transaction ¶
func (b *BaseDatabase) Transaction(readWrite bool) *Txn
Transaction starts a new database transaction and returns a handle to it
type CommitTimestamp ¶
CommitTimestamp represents the sqlite table used to track the current commit timestamp
func (CommitTimestamp) TableName ¶
func (CommitTimestamp) TableName() string
type CommitTimestampError ¶
func (CommitTimestampError) Error ¶
func (e CommitTimestampError) Error() string
type InMemoryDatabase ¶
type InMemoryDatabase struct {
*BaseDatabase
}
InMemoryDatabase stores all data in memory. Data will not be persisted
func NewInMemory ¶
func NewInMemory(logger *slog.Logger) (*InMemoryDatabase, error)
NewInMemory creates a new in-memory database
type PersistentDatabase ¶
type PersistentDatabase struct { *BaseDatabase // contains filtered or unexported fields }
PersistentDatabase stores its data on disk, providing persistence across restarts
func NewPersistent ¶
func NewPersistent( dataDir string, logger *slog.Logger, ) (*PersistentDatabase, error)
NewPersistent creates a new persistent database instance using the provided data directory
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
Txn is a wrapper around the transaction objects for the underlying DB engines