func DeleteSetting(db *gorm.DB, id int) Setting {
	setting := FetchSetting(db, id)
	db.Delete(&setting)
	return setting
}
DeleteSetting removes a setting with the matching id from the database
package structs
import (
	"fmt"
	"gorm.io/gorm"
)
type Setting struct {
	gorm.Model
	Key   string `gorm:"size:255"`
	Value string `gorm:"size:255"`
}
func CreateSetting(db *gorm.DB, key string, value string) bool {
	setting := Setting{
		Key:   key,
		Value: value,
	}
	if err := db.Create(&setting).Error; err != nil {
		fmt.Println("Could not create setting")
		return false
	}
	return true
}
func FetchSetting(db *gorm.DB, id int) Setting {
	setting := Setting{}
	db.First(&setting, id)
	return setting
}
func FetchSettingByKey(db *gorm.DB, key string) Setting {
	setting := Setting{}
	db.Where("key = ?", key).First(&setting)
	return setting
}
func FetchSettings(db *gorm.DB) (settings []Setting) {
	db.Find(&settings)
	return settings
}
func UpdateSetting(db *gorm.DB, id int, key string, value string) bool {
	setting := FetchSetting(db, id)
	setting.Key = key
	setting.Value = value
	if err := db.Save(&setting).Error; err != nil {
		fmt.Println("Could not create setting")
		return false
	}
	return true
}