WIP on testing SQLite data store
This commit is contained in:
@@ -443,7 +443,7 @@ module Theme =
|
||||
let themeName = fileName.Split(".").[0].ToLowerInvariant().Replace(" ", "-")
|
||||
if themeName.EndsWith "-theme" then
|
||||
if Regex.IsMatch(themeName, """^[a-z0-9\-]+$""") then
|
||||
Ok(ThemeId(themeName[..themeName.Length - 6]))
|
||||
Ok(ThemeId(themeName[..themeName.Length - 7]))
|
||||
else Error $"Theme ID {fileName} is invalid"
|
||||
else Error "Theme .zip file name must end in \"-theme.zip\""
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ module CatchAll =
|
||||
let textLink =
|
||||
let extra = webLog.ExtraPath
|
||||
let url = string ctx.Request.Path
|
||||
(if extra = "" then url else url[..extra.Length]).ToLowerInvariant()
|
||||
(if extra = "" then url else url[extra.Length..]).ToLowerInvariant()
|
||||
let await it = (Async.AwaitTask >> Async.RunSynchronously) it
|
||||
seq {
|
||||
debug (fun () -> $"Considering URL {textLink}")
|
||||
|
||||
@@ -79,7 +79,7 @@ module DataImplementation =
|
||||
let createSQLite connStr : IData =
|
||||
Sqlite.Configuration.useConnectionString connStr
|
||||
let log = sp.GetRequiredService<ILogger<SQLiteData>>()
|
||||
let conn = new SqliteConnection(connStr)
|
||||
let conn = Sqlite.Configuration.dbConn ()
|
||||
log.LogInformation $"Using SQLite database {conn.DataSource}"
|
||||
SQLiteData(conn, log, Json.configure (JsonSerializer.CreateDefault()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user