Versions in this module Expand all Collapse all v0 v0.4.2 Jul 22, 2025 v0.4.1 Jul 19, 2025 v0.4.0 Jul 12, 2025 v0.3.1 Jul 9, 2025 v0.3.0 Jul 9, 2025 Changes in this version + const MaxTagLength + const MaxTagsPerCommand type CommandRecord + TagColors map[string]string + Tags []string + func (cr *CommandRecord) AddTag(tag string) error + func (cr *CommandRecord) ClearTagColor(tagName string) + func (cr *CommandRecord) GetTagColor(tagName string) string + func (cr *CommandRecord) GetTagsString() string + func (cr *CommandRecord) HasTag(tag string) bool + func (cr *CommandRecord) HasTagColor(tagName string) bool + func (cr *CommandRecord) HasTags() bool + func (cr *CommandRecord) RemoveTag(tag string) bool + func (cr *CommandRecord) SetTagColor(tagName, color string) + func (cr *CommandRecord) SetTags(tags []string) error v0.2.0 Jul 4, 2025 Changes in this version + const MaxNoteLength type CommandRecord + Note string + func (cr *CommandRecord) ClearNote() + func (cr *CommandRecord) GetNotePreview(maxLength int) string + func (cr *CommandRecord) HasNote() bool + func (cr *CommandRecord) IsNoteValid() bool + func (cr *CommandRecord) SetNote(note string) error type Database + func (db *Database) GetLastCommandTimestamp() (int64, error) v0.1.3 Jun 29, 2025 v0.1.2 Jun 29, 2025 v0.1.1 Jun 28, 2025 v0.1.0 Jun 26, 2025 Changes in this version + const CurrentSchemaVersion + const MaxCommandLength + const MaxEnvironmentSize + const MaxEnvironmentVars + const MaxHostnameLength + const MaxSessionIDLength + const MaxWorkingDirLength + const MinSupportedVersion + const SyncStatusConflict + const SyncStatusLocal + const SyncStatusSynced + var DatabaseConstraints = map[string]interface + type CommandRecord struct + Command string + CreatedAt int64 + DeviceID string + Duration int64 + Environment map[string]string + ExitCode int + GitBranch string + GitCommit string + GitRoot string + Hostname string + ID int64 + LastSynced *int64 + RecordHash string + SessionID string + Shell string + SyncStatus int + TTY string + Timestamp int64 + User string + Version int + WorkingDir string + func NewCommandRecord(command string, exitCode int, duration int64, ...) *CommandRecord + func (cr *CommandRecord) IsValid() bool + func (cr *CommandRecord) MarkSynced() + func (cr *CommandRecord) NeedsSync() bool + type Database struct + func NewDatabase(cfg *config.Config, opts *DatabaseOptions) (*Database, error) + func (db *Database) BeginTransaction() (*sql.Tx, error) + func (db *Database) BeginTx() (*sql.Tx, error) + func (db *Database) CheckIntegrity() error + func (db *Database) Close() error + func (db *Database) ExecContext(query string, args ...interface{}) (sql.Result, error) + func (db *Database) GetAllEncryptedRecords(tx *sql.Tx) ([]EncryptedHistoryRecord, error) + func (db *Database) GetConfig() *config.DatabaseConfig + func (db *Database) GetDB() *sql.DB + func (db *Database) GetMigrator() *Migrator + func (db *Database) GetPath() string + func (db *Database) GetSize() (int64, error) + func (db *Database) IsConnected() bool + func (db *Database) QueryContext(query string, args ...interface{}) (*sql.Rows, error) + func (db *Database) QueryRowContext(query string, args ...interface{}) *sql.Row + func (db *Database) SetSecureDeleteMode(enabled bool) error + func (db *Database) Stats() sql.DBStats + func (db *Database) UpdateEncryptedData(tx *sql.Tx, recordID int64, newEncryptedData []byte) error + func (db *Database) Vacuum() error + type DatabaseOptions struct + Config *config.DatabaseConfig + CreateIfMissing bool + MigrateOnOpen bool + ValidateSchema bool + type DatabaseSchema struct + Indexes []string + Migrations map[int][]string + Tables []string + Version int + func GetCurrentSchema() *DatabaseSchema + type EncryptedHistoryRecord struct + CreatedAt int64 + EncryptedData []byte + Hostname string + ID int64 + Session string + Timestamp int64 + func (ehr *EncryptedHistoryRecord) GetSearchableFields() map[string]interface{} + type Migrator struct + func NewMigrator(db *sql.DB, schema *DatabaseSchema) *Migrator + func (m *Migrator) CheckIntegrity() error + func (m *Migrator) GetCurrentVersion() (int, error) + func (m *Migrator) GetMigrationHistory() ([]SchemaVersion, error) + func (m *Migrator) InitializeSchema() error + func (m *Migrator) MigrateToLatest() error + func (m *Migrator) ValidateSchema() error + type SchemaVersion struct + AppliedAt int64 + Description string + Version int + type SessionMetadata struct + CreatedAt int64 + EndTime *int64 + Hostname string + SessionID string + ShellType string + StartTime int64 + UserName string