Versions in this module Expand all Collapse all v0 v0.5.3 Dec 19, 2025 v0.5.2 Dec 19, 2025 v0.5.1 Dec 18, 2025 Changes in this version + type CatalogColumn struct + DataType string + DefaultValue *string + IsNullable bool + Name string + Position int + Schema string + TableName string + type CatalogFunction struct + ArgTypes []string + Description string + FunctionType string + IsDeterministic bool + Language string + Name string + ReturnType string + Schema string + type CatalogJob struct + CatchUp bool + CreatedAt time.Time + CronExpr string + Enabled bool + IntervalMs int64 + LastRunAt *time.Time + MaxRuntimeMs int64 + Name string + NextRunAt *time.Time + NoOverlap bool + RunAt *time.Time + SQLText string + ScheduleType string + Timezone string + UpdatedAt time.Time + type CatalogManager struct + func NewCatalogManager() *CatalogManager + func (c *CatalogManager) DeleteJob(name string) error + func (c *CatalogManager) GetAllColumns() []CatalogColumn + func (c *CatalogManager) GetColumns(schema, tableName string) []CatalogColumn + func (c *CatalogManager) GetFunctions() []*CatalogFunction + func (c *CatalogManager) GetJob(name string) (*CatalogJob, error) + func (c *CatalogManager) GetTables() []*CatalogTable + func (c *CatalogManager) GetViews() []*CatalogView + func (c *CatalogManager) ListEnabledJobs() []*CatalogJob + func (c *CatalogManager) ListJobs() []*CatalogJob + func (c *CatalogManager) RegisterFunction(fn *CatalogFunction) error + func (c *CatalogManager) RegisterJob(job *CatalogJob) error + func (c *CatalogManager) RegisterTable(schema, name string, cols []Column) error + func (c *CatalogManager) RegisterView(schema, name, sqlText string) error + func (c *CatalogManager) UpdateJobRuntime(name string, lastRun, nextRun time.Time) error + type CatalogTable struct + CreatedAt time.Time + Name string + RowCount int64 + Schema string + Type string + UpdatedAt time.Time + type CatalogView struct + CreatedAt time.Time + Name string + SQLText string + Schema string type DB + func (db *DB) Catalog() *CatalogManager + type JobExecutor interface + ExecuteSQL func(ctx context.Context, sql string) (interface{}, error) + type Scheduler struct + func NewScheduler(db *DB, executor JobExecutor) *Scheduler + func (s *Scheduler) AddJob(job *CatalogJob) error + func (s *Scheduler) RemoveJob(name string) error + func (s *Scheduler) Start() error + func (s *Scheduler) Stop() v0.5.0 Dec 3, 2025 v0.4.1 Nov 25, 2025 v0.4.0 Nov 25, 2025 v0.3.1 Oct 3, 2025 v0.3.0 Oct 1, 2025 v0.2.1 Oct 1, 2025 v0.2.0 Oct 1, 2025 Changes in this version + var ErrRowNotFound = fmt.Errorf("row not found") + var ErrSerializationFailure = fmt.Errorf("could not serialize access due to concurrent update") + var ErrTxNotActive = fmt.Errorf("transaction is not active") + func EstimateColumnSize(typ ColType) int64 + func EstimateTableSize(t *Table) int64 + func EstimateValueSize(val any) int64 + func FanIn(ctx context.Context, channels ...<-chan interface{}) <-chan interface + func FanOut(ctx context.Context, input <-chan interface{}, workers int) []<-chan interface + func SaveToBytes(db *DB) ([]byte, error) + func SaveToFile(db *DB, filename string) error + func SaveToWriter(db *DB, w io.Writer) error + type AdvancedWAL struct + func OpenAdvancedWAL(config AdvancedWALConfig) (*AdvancedWAL, error) + func (w *AdvancedWAL) Checkpoint(db *DB) error + func (w *AdvancedWAL) Close() error + func (w *AdvancedWAL) GetCommittedLSN() LSN + func (w *AdvancedWAL) GetFlushedLSN() LSN + func (w *AdvancedWAL) GetNextLSN() LSN + func (w *AdvancedWAL) LogAbort(txID TxID) (LSN, error) + func (w *AdvancedWAL) LogBegin(txID TxID) (LSN, error) + func (w *AdvancedWAL) LogCommit(txID TxID) (LSN, error) + func (w *AdvancedWAL) LogDelete(txID TxID, tenant, table string, rowID int64, before []any, cols []Column) (LSN, error) + func (w *AdvancedWAL) LogInsert(txID TxID, tenant, table string, rowID int64, data []any, cols []Column) (LSN, error) + func (w *AdvancedWAL) LogUpdate(txID TxID, tenant, table string, rowID int64, before, after []any, ...) (LSN, error) + func (w *AdvancedWAL) Recover(db *DB) (int, error) + func (w *AdvancedWAL) ShouldCheckpoint() bool + type AdvancedWALConfig struct + BufferSize int + CheckpointEvery uint64 + CheckpointInterval time.Duration + CheckpointPath string + Compress bool + Path string + type BatchHandler func(items []interface{}) error + type BatchProcessor struct + func NewBatchProcessor(maxSize int, interval time.Duration, handler BatchHandler) *BatchProcessor + func (bp *BatchProcessor) Add(item interface{}) error + func (bp *BatchProcessor) Run(ctx context.Context, wg *sync.WaitGroup) + type BufferPool struct + func NewBufferPool(policy *MemoryPolicy) *BufferPool + func (bp *BufferPool) Get(tenant, name string) (*Table, bool) + func (bp *BufferPool) GetMemoryLimit() int64 + func (bp *BufferPool) GetMemoryUsage() int64 + func (bp *BufferPool) GetStats() CacheStats + func (bp *BufferPool) Put(tenant, name string, table *Table) error + func (bp *BufferPool) Remove(tenant, name string) + type CacheStats struct + CacheHits int64 + CacheMisses int64 + EvictionCount int64 + EvictionSize int64 + HitRate float64 + MemoryLimit int64 + MemoryUsed int64 + MemoryUtilization float64 + TablesInMemory int + TablesOnDisk int + type CacheStrategy int + const StrategyARC + const StrategyLFU + const StrategyLRU + const StrategyNone + func (s CacheStrategy) String() string + type CachedTable struct + AccessCount int64 + DiskOffset int64 + LastAccess time.Time + LoadedAt time.Time + OnDisk bool + Pinned bool + Size int64 + Table *Table + type ColType int + const ArrayType + const BoolType + const ByteType + const Complex128Type + const Complex64Type + const ComplexType + const DateTimeType + const DateType + const DurationType + const Float32Type + const Float64Type + const FloatType + const Int16Type + const Int32Type + const Int64Type + const Int8Type + const IntType + const InterfaceType + const JsonType + const JsonbType + const MapType + const PointerType + const RuneType + const SliceType + const StringType + const TextType + const TimeType + const TimestampType + const Uint16Type + const Uint32Type + const Uint64Type + const Uint8Type + const UintType + func (t ColType) String() string + type Column struct + Constraint ConstraintType + ForeignKey *ForeignKeyRef + Name string + PointerTable string + Type ColType + type ConcurrencyConfig struct + BatchInterval time.Duration + BatchSize int + QueueTimeout time.Duration + ReadQueueSize int + ReadWorkers int + WorkerTimeout time.Duration + WriteQueueSize int + WriteWorkers int + func DefaultConcurrencyConfig() ConcurrencyConfig + type ConcurrencyManager struct + func NewConcurrencyManager(config ConcurrencyConfig) *ConcurrencyManager + func (cm *ConcurrencyManager) Shutdown(timeout time.Duration) error + func (cm *ConcurrencyManager) Stats() *ConcurrencyStats + func (cm *ConcurrencyManager) SubmitRead(ctx context.Context, data interface{}) <-chan WorkResult + func (cm *ConcurrencyManager) SubmitWrite(ctx context.Context, data interface{}) <-chan WorkResult + type ConcurrencyStats struct + ActiveWorkers atomic.Int64 + CompletedReads atomic.Uint64 + CompletedWrites atomic.Uint64 + FailedRequests atomic.Uint64 + QueuedReads atomic.Int64 + QueuedWrites atomic.Int64 + TotalRequests atomic.Uint64 + type ConstraintType int + const ForeignKey + const NoConstraint + const PrimaryKey + const Unique + func (c ConstraintType) String() string + type DB struct + func LoadFromBytes(b []byte) (*DB, error) + func LoadFromFile(filename string) (*DB, error) + func LoadFromReader(r io.Reader) (*DB, error) + func NewDB() *DB + func (db *DB) AdvancedWAL() *AdvancedWAL + func (db *DB) AttachAdvancedWAL(wal *AdvancedWAL) + func (db *DB) DeepClone() *DB + func (db *DB) Drop(tn, name string) error + func (db *DB) Get(tn, name string) (*Table, error) + func (db *DB) ListTables(tn string) []*Table + func (db *DB) MVCC() *MVCCManager + func (db *DB) Put(tn string, t *Table) error + func (db *DB) WAL() *WALManager + type ForeignKeyRef struct + Column string + Table string + type IsolationLevel uint8 + const ReadCommitted + const RepeatableRead + const Serializable + const SnapshotIsolation + type LRUNode struct + type LRUQueue struct + func NewLRUQueue() *LRUQueue + func (lru *LRUQueue) Access(key string, table *CachedTable) + func (lru *LRUQueue) Add(key string, table *CachedTable) + func (lru *LRUQueue) Remove(key string) + func (lru *LRUQueue) RemoveLRU() (string, *CachedTable) + type LSN uint64 + type MVCCManager struct + func NewMVCCManager() *MVCCManager + func (m *MVCCManager) AbortTx(tx *TxContext) + func (m *MVCCManager) BeginTx(level IsolationLevel) *TxContext + func (m *MVCCManager) CommitTx(tx *TxContext) (Timestamp, error) + func (m *MVCCManager) GCWatermark() Timestamp + func (m *MVCCManager) IsVisible(tx *TxContext, rv *RowVersion) bool + type MVCCTable struct + func NewMVCCTable(name string, cols []Column, isTemp bool) *MVCCTable + func (t *MVCCTable) DeleteVersion(tx *TxContext, rowID int64) error + func (t *MVCCTable) GarbageCollect(watermark Timestamp) int + func (t *MVCCTable) GetVisibleVersion(mvcc *MVCCManager, tx *TxContext, rowID int64) *RowVersion + func (t *MVCCTable) InsertVersion(tx *TxContext, data []any) int64 + func (t *MVCCTable) UpdateVersion(tx *TxContext, rowID int64, newData []any) error + type MemoryPolicy struct + AccessWindow time.Duration + EnableEviction bool + EvictionBatchSize int + EvictionThreshold float64 + IgnoreTables []string + MaxMemoryBytes int64 + PinnedTables []string + Strategy CacheStrategy + TrackAccessPatterns bool + func DefaultMemoryPolicy() *MemoryPolicy + func LimitedMemoryPolicy(maxMB int64) *MemoryPolicy + type ParallelIterator struct + func NewParallelIterator(items []interface{}, workers int) *ParallelIterator + func (pi *ParallelIterator) ForEach(fn func(item interface{}) error) error + func (pi *ParallelIterator) Map(fn func(item interface{}) (interface{}, error)) ([]interface{}, error) + func (pi *ParallelIterator) WithContext(ctx context.Context) *ParallelIterator + type Pipeline struct + func NewPipeline(ctx context.Context, stages ...PipelineStage) *Pipeline + func (p *Pipeline) Execute(input []interface{}) <-chan interface{} + type PipelineStage func(ctx context.Context, input <-chan interface{}) <-chan interface + type RateLimiter struct + func NewRateLimiter(opsPerSecond int) *RateLimiter + func (rl *RateLimiter) Stop() + func (rl *RateLimiter) Wait(ctx context.Context) error + type RowVersion struct + CreatedAt Timestamp + Data []any + DeletedAt Timestamp + NextVersion *RowVersion + XMax TxID + XMin TxID + type Table struct + Cols []Column + IsTemp bool + Name string + Rows [][]any + Version int + func NewTable(name string, cols []Column, isTemp bool) *Table + func (t *Table) ColIndex(name string) (int, error) + type Timestamp uint64 + type TxContext struct + ID TxID + IsolationLevel IsolationLevel + ReadSet map[string]map[int64]Timestamp + ReadSnapshot Timestamp + StartTime Timestamp + Status TxStatus + WriteSet map[string]map[int64]bool + func (tx *TxContext) RecordRead(table string, rowID int64, version Timestamp) + func (tx *TxContext) RecordWrite(table string, rowID int64) + type TxID uint64 + type TxStatus uint8 + const TxStatusAborted + const TxStatusCommitted + const TxStatusInProgress + type WALChange struct + Drop bool + Name string + Table *Table + Tenant string + func CollectWALChanges(prev, next *DB) []WALChange + type WALConfig struct + CheckpointEvery uint64 + CheckpointInterval time.Duration + Path string + type WALManager struct + func OpenWAL(db *DB, cfg WALConfig) (*WALManager, error) + func (w *WALManager) Checkpoint(db *DB) error + func (w *WALManager) Close() error + func (w *WALManager) LogTransaction(changes []WALChange) (bool, error) + type WALOperationType uint8 + const WALOpAbort + const WALOpBegin + const WALOpCheckpoint + const WALOpCommit + const WALOpDelete + const WALOpInsert + const WALOpUpdate + func (t WALOperationType) String() string + type WALRecord struct + AfterImage []any + BeforeImage []any + Checksum uint32 + Columns []Column + LSN LSN + OpType WALOperationType + RowID int64 + Table string + Tenant string + Timestamp time.Time + TxID TxID + type WALTxState struct + Operations []LSN + StartLSN LSN + Status TxStatus + TxID TxID + type WorkHandler func(ctx context.Context, req WorkRequest) WorkResult + type WorkRequest struct + Context context.Context + Data interface{} + ID uint64 + Result chan WorkResult + Type WorkType + type WorkResult struct + Data interface{} + Error error + ID uint64 + type WorkType uint8 + const WorkTypeBatch + const WorkTypeDelete + const WorkTypeRead + const WorkTypeScan + const WorkTypeWrite + type WorkerPool struct + func NewWorkerPool(name string, size int, workQueue chan WorkRequest, handler WorkHandler, ...) *WorkerPool + func (wp *WorkerPool) Start() v0.1.3 Sep 29, 2025 v0.1.2 Sep 27, 2025 v0.1.1 Sep 27, 2025