refactor: use modernc sqlite driver as default (#37562)
cache-seeder / gobuild (push) Failing after 20m23s
cache-seeder / lint (lint-backend, bindata, lint-backend) (push) Failing after 29m29s
cache-seeder / lint (lint-go-gogit, bindata gogit, lint-go) (push) Failing after 29m38s
cache-seeder / lint (lint-go-windows, bindata, lint-go-windows) (push) Failing after 29m39s
cron-translations / crowdin-pull (push) Has been skipped
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled
cron-renovate / cron-renovate (push) Has been skipped

The mattn driver is still kept, can be enabled by
TAGS="sqlite_mattn sqlite_unlock_notify"

---------

Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
wxiaoguang
2026-05-07 02:57:59 +08:00
committed by GitHub
parent b093c2c43c
commit a39af1a829
34 changed files with 185 additions and 149 deletions
+3 -8
View File
@@ -123,7 +123,7 @@ func Install(ctx *context.Context) {
func checkDatabase(ctx *context.Context, form *forms.InstallForm) bool {
var err error
if (setting.Database.Type == "sqlite3") &&
if (setting.Database.Type == setting.DatabaseTypeSQLite3) &&
len(setting.Database.Path) == 0 {
ctx.Data["Err_DbPath"] = true
ctx.RenderWithErrDeprecated(ctx.Tr("install.err_empty_db_path"), tplInstall, form)
@@ -135,13 +135,8 @@ func checkDatabase(ctx *context.Context, form *forms.InstallForm) bool {
defer db.UnsetDefaultEngine()
if err = db.InitEngine(ctx); err != nil {
if strings.Contains(err.Error(), `Unknown database type: sqlite3`) {
ctx.Data["Err_DbType"] = true
ctx.RenderWithErrDeprecated(ctx.Tr("install.sqlite3_not_available", "https://docs.gitea.com/installation/install-from-binary"), tplInstall, form)
} else {
ctx.Data["Err_DbSetting"] = true
ctx.RenderWithErrDeprecated(ctx.Tr("install.invalid_db_setting", err), tplInstall, form)
}
ctx.Data["Err_DbSetting"] = true
ctx.RenderWithErrDeprecated(ctx.Tr("install.invalid_db_setting", err), tplInstall, form)
return false
}