MCPcopy Create free account
hub / github.com/cloudbase/garm / runSQLiteMaintenance

Method runSQLiteMaintenance

database/sql/sql.go:169–176  ·  view source on GitHub ↗
(conn *gorm.DB, dbName string)

Source from the content-addressed store, hash-verified

167}
168
169func (s *sqlDatabase) runSQLiteMaintenance(conn *gorm.DB, dbName string) {
170 if err := conn.Exec("PRAGMA wal_checkpoint(TRUNCATE)").Error; err != nil {
171 slog.With(slog.Any("error", err)).ErrorContext(s.ctx, "failed to checkpoint WAL", "database", dbName)
172 }
173 if err := conn.Exec("PRAGMA incremental_vacuum").Error; err != nil {
174 slog.With(slog.Any("error", err)).ErrorContext(s.ctx, "failed to incremental vacuum database", "database", dbName)
175 }
176}
177
178var renameTemplate = `
179PRAGMA foreign_keys = OFF;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected