2021-11-23 09:45:38 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
_ "github.com/mattn/go-sqlite3" // Load the SQLite Driver used in the connection string.
|
2021-12-01 12:11:29 +00:00
|
|
|
|
|
|
|
"github.com/authelia/authelia/v4/internal/configuration/schema"
|
2021-11-23 09:45:38 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// SQLiteProvider is a SQLite3 provider.
|
|
|
|
type SQLiteProvider struct {
|
|
|
|
SQLProvider
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewSQLiteProvider constructs a SQLite provider.
|
2021-12-01 12:11:29 +00:00
|
|
|
func NewSQLiteProvider(config *schema.Configuration) (provider *SQLiteProvider) {
|
2021-11-23 09:45:38 +00:00
|
|
|
provider = &SQLiteProvider{
|
2021-12-01 12:11:29 +00:00
|
|
|
SQLProvider: NewSQLProvider(config, providerSQLite, "sqlite3", config.Storage.Local.Path),
|
2021-11-23 09:45:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// All providers have differing SELECT existing table statements.
|
|
|
|
provider.sqlSelectExistingTables = querySQLiteSelectExistingTables
|
|
|
|
|
|
|
|
return provider
|
|
|
|
}
|