@@ -48,6 +48,7 @@ import (
4848 "github.com/foxcpp/maddy/framework/log"
4949 "github.com/foxcpp/maddy/framework/module"
5050 "github.com/foxcpp/maddy/internal/authz"
51+ sqliteprovider "github.com/foxcpp/maddy/internal/sqlite"
5152 "github.com/foxcpp/maddy/internal/updatepipe"
5253 "github.com/foxcpp/maddy/internal/updatepipe/pubsub"
5354
@@ -172,16 +173,16 @@ func (store *Storage) Configure(inlineArgs []string, cfg *config.Map) error {
172173 return errors .New ("imapsql: driver is required" )
173174 }
174175
175- if driver == "sqlite3" {
176- if sqliteImpl == "modernc" {
177- store .Log .Println ("using transpiled SQLite (modernc.org/sqlite), this is experimental" )
178- driver = "sqlite"
179- } else if sqliteImpl == "cgo" {
176+ if sqliteprovider .IsSqliteDriver (driver ) {
177+ if sqliteprovider .IsTranspiled {
178+ store .Log .Println ("using transpiled SQLite (modernc.org/sqlite)" )
179+ } else if sqliteprovider .IsAvailable {
180180 store .Log .Debugln ("using cgo SQLite" )
181- } else if sqliteImpl == "missing" {
181+ } else {
182182 return errors .New ("imapsql: SQLite is not supported, recompile without no_sqlite3 tag set" )
183183 }
184184 }
185+ driver = sqliteprovider .MapDriverName (driver )
185186
186187 deliveryNormFunc , ok := authz .NormalizeFuncs [deliveryNormalize ]
187188 if ! ok {
@@ -301,7 +302,7 @@ func (store *Storage) EnableUpdatePipe(mode updatepipe.BackendMode) error {
301302 }
302303
303304 switch store .driver {
304- case "sqlite3" :
305+ case "sqlite3" , "sqlite" :
305306 dbId := sha1 .Sum ([]byte (strings .Join (store .dsn , " " )))
306307 sockPath := filepath .Join (
307308 config .RuntimeDirectory ,
0 commit comments