Fix SQLite page list query
This commit is contained in:
parent
a0ab99f737
commit
5ce84e18ca
@ -53,7 +53,7 @@ type SQLitePageData(conn: SqliteConnection, log: ILogger) =
|
|||||||
let countListed webLogId =
|
let countListed webLogId =
|
||||||
log.LogTrace "Page.countListed"
|
log.LogTrace "Page.countListed"
|
||||||
conn.customScalar
|
conn.customScalar
|
||||||
$"""{Document.Query.countByWebLog Table.Page} AND {Query.whereByField pgListName EQ "'true'"}"""
|
$"""{Document.Query.countByWebLog Table.Page} AND {Query.whereByField pgListName EQ "true"}"""
|
||||||
[ webLogParam webLogId ]
|
[ webLogParam webLogId ]
|
||||||
(toCount >> int)
|
(toCount >> int)
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ type SQLitePageData(conn: SqliteConnection, log: ILogger) =
|
|||||||
let findListed webLogId =
|
let findListed webLogId =
|
||||||
log.LogTrace "Page.findListed"
|
log.LogTrace "Page.findListed"
|
||||||
conn.customList
|
conn.customList
|
||||||
$"""{Document.Query.selectByWebLog Table.Page} AND {Query.whereByField pgListName EQ "'true'"}
|
$"""{Document.Query.selectByWebLog Table.Page} AND {Query.whereByField pgListName EQ "true"}
|
||||||
ORDER BY LOWER({titleField})"""
|
ORDER BY LOWER({titleField})"""
|
||||||
[ webLogParam webLogId ]
|
[ webLogParam webLogId ]
|
||||||
(fun rdr -> { fromData<Page> rdr with Text = "" })
|
(fun rdr -> { fromData<Page> rdr with Text = "" })
|
||||||
|
@ -49,7 +49,7 @@ type SQLiteWebLogUserData(conn: SqliteConnection, log: ILogger) =
|
|||||||
/// Find the names of users by their IDs for the given web log
|
/// Find the names of users by their IDs for the given web log
|
||||||
let findNames webLogId (userIds: WebLogUserId list) =
|
let findNames webLogId (userIds: WebLogUserId list) =
|
||||||
log.LogTrace "WebLogUser.findNames"
|
log.LogTrace "WebLogUser.findNames"
|
||||||
let nameSql, nameParams = inClause "AND data ->> 'Id'" "id" string userIds
|
let nameSql, nameParams = inClause $"AND data ->> '{nameof WebLogUser.Empty.Id}'" "id" string userIds
|
||||||
conn.customList
|
conn.customList
|
||||||
$"{Document.Query.selectByWebLog Table.WebLogUser} {nameSql}"
|
$"{Document.Query.selectByWebLog Table.WebLogUser} {nameSql}"
|
||||||
(webLogParam webLogId :: nameParams)
|
(webLogParam webLogId :: nameParams)
|
||||||
|
Loading…
Reference in New Issue
Block a user