Documentation
¶
Index ¶
- Variables
- func AfterLegacyDelete(path string, action func() error) error
- func CanonicalLegacySourcePath(configured, persisted string) (string, error)
- func CheckIntegrity(db *gorm.DB) error
- func CreateInSafeBatches[T any](ctx context.Context, target *gorm.DB, values []T, conflict clause.OnConflict) error
- func CreateInSafeBatchesCount[T any](ctx context.Context, target *gorm.DB, values []T, conflict clause.OnConflict) (int64, error)
- func InitializeFreshCore(ctx context.Context, target *gorm.DB, now func() time.Time) error
- func LegacyDeleteMarkerPath(path string) string
- func QuickCheck(db *gorm.DB) error
- func RetireCoreBillingProjectionTables(ctx context.Context, core, logDB *gorm.DB) (bool, error)
- func SplitManifestPath(legacyPath string) string
- func ValidateLegacyCleanerTargets(core, logDB *gorm.DB) error
- func ValidatePaths(corePath, logPath string) error
- type BootstrapOptions
- type BootstrapResult
- type Connector
- func (c *Connector) OpenCore(path string) (*gorm.DB, error)
- func (c *Connector) OpenCorePath(path string) (*gorm.DB, error)
- func (c *Connector) OpenExistingCore(path string) (*gorm.DB, error)
- func (c *Connector) OpenExistingCorePath(path string) (*gorm.DB, error)
- func (c *Connector) OpenExistingLog(path string) (*gorm.DB, error)
- func (c *Connector) OpenExistingLogPath(path string) (*gorm.DB, error)
- func (c *Connector) OpenLegacyReadOnly(layout LegacyLayoutInfo) (*gorm.DB, error)
- func (c *Connector) OpenLog(path string) (*gorm.DB, error)
- func (c *Connector) OpenLogPath(path string) (*gorm.DB, error)
- func (c *Connector) ReadHistoryMigrationMarker(path string) (models.HistoryMigration, bool, error)
- type LegacyArtifact
- type LegacyArtifactDeletionCommand
- type LegacyArtifactDeletionValidator
- type LegacyFileCleaner
- type LegacyLayout
- type LegacyLayoutInfo
- type ParsedSQLiteDSN
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLegacyDeleteInProgress = errors.New("legacy delete operation is already in progress")
View Source
var ErrSameSQLiteFile = errors.New("SQLite paths resolve to same SQLite file")
Functions ¶
func AfterLegacyDelete ¶
func CheckIntegrity ¶
func CreateInSafeBatches ¶
func InitializeFreshCore ¶
func LegacyDeleteMarkerPath ¶
func QuickCheck ¶
func RetireCoreBillingProjectionTables ¶ added in v0.0.15
RetireCoreBillingProjectionTables removes obsolete core rollups only after the version 1 log-owned daily backfill has durably completed.
func SplitManifestPath ¶
func ValidatePaths ¶
Types ¶
type BootstrapOptions ¶
type BootstrapResult ¶
type BootstrapResult struct {
Created bool
SourceKind LegacyLayout
CopiedRows int64
}
func BootstrapCore ¶
func BootstrapCore(ctx context.Context, source, target *gorm.DB, layout LegacyLayoutInfo, options BootstrapOptions) (BootstrapResult, error)
type Connector ¶
type Connector struct{}
func NewConnector ¶
func NewConnector() *Connector
func (*Connector) OpenExistingCore ¶
func (*Connector) OpenExistingCorePath ¶
func (*Connector) OpenExistingLog ¶
func (*Connector) OpenExistingLogPath ¶
func (*Connector) OpenLegacyReadOnly ¶
func (c *Connector) OpenLegacyReadOnly(layout LegacyLayoutInfo) (*gorm.DB, error)
func (*Connector) ReadHistoryMigrationMarker ¶
type LegacyArtifact ¶
type LegacyArtifact struct {
Path string `json:"path"`
SizeBytes int64 `json:"size_bytes"`
Exists bool `json:"exists"`
InUse bool `json:"in_use"`
Available bool `json:"available"`
LastError string `json:"last_error"`
CanDelete bool `json:"can_delete"`
DeleteError string `json:"delete_error"`
}
func FindLegacyArtifact ¶
func FindLegacyArtifact(legacyDBPath string) (LegacyArtifact, error)
type LegacyArtifactDeletionCommand ¶
type LegacyArtifactDeletionCommand struct {
FindArtifact func() (LegacyArtifact, error)
BuildValidator func() LegacyArtifactDeletionValidator
}
func (LegacyArtifactDeletionCommand) Delete ¶
func (c LegacyArtifactDeletionCommand) Delete(confirmation string) error
type LegacyArtifactDeletionValidator ¶
type LegacyArtifactDeletionValidator struct {
CoreDB *gorm.DB
LogDB *gorm.DB
LogDatabaseReady bool
CoreDatabaseDSN string
LogDatabaseDSN string
ActiveLegacySources []string
}
func (LegacyArtifactDeletionValidator) Check ¶
func (v LegacyArtifactDeletionValidator) Check(artifact LegacyArtifact) LegacyArtifact
type LegacyFileCleaner ¶
type LegacyFileCleaner struct {
ExpectedPath string
MigrationState string
BatchRunning func() bool
ValidateTargets func() error
ValidateArtifactDeletion func() error
// contains filtered or unexported fields
}
func (LegacyFileCleaner) DeleteArtifact ¶
func (c LegacyFileCleaner) DeleteArtifact(path, confirmation string) error
func (LegacyFileCleaner) DeleteConfiguredSource ¶
func (c LegacyFileCleaner) DeleteConfiguredSource(configuredPath, persistedPath, confirmation string) error
func (LegacyFileCleaner) DeletePath ¶
func (c LegacyFileCleaner) DeletePath(path, confirmation string) error
type LegacyLayout ¶
type LegacyLayout string
const ( LegacyLayoutNone LegacyLayout = "none" LegacyLayoutMonolith LegacyLayout = "monolith" LegacyLayoutV5Core LegacyLayout = "v5_core" )
type LegacyLayoutInfo ¶
type LegacyLayoutInfo struct {
Kind LegacyLayout
Path string
}
func FindLegacyLayout ¶
func FindLegacyLayout(dsn string) (LegacyLayoutInfo, error)
type ParsedSQLiteDSN ¶
func ParseSQLiteDSN ¶
func ParseSQLiteDSN(raw string) (ParsedSQLiteDSN, error)
Click to show internal directories.
Click to hide internal directories.