Tweak PostgreSQL calls

This commit is contained in:
2024-08-19 22:45:14 -04:00
parent fbc4e891bd
commit d4c0e4e26c
8 changed files with 42 additions and 49 deletions
@@ -50,14 +50,14 @@ type PostgresWebLogUserData(log: ILogger) =
let findByWebLog webLogId =
log.LogTrace "WebLogUser.findByWebLog"
Custom.list
$"{selectWithCriteria Table.WebLogUser} ORDER BY LOWER(data ->> '{nameof WebLogUser.Empty.PreferredName}')"
$"{selectWithCriteria Table.WebLogUser} ORDER BY LOWER(data->>'{nameof WebLogUser.Empty.PreferredName}')"
[ webLogContains webLogId ]
fromData<WebLogUser>
/// Find the names of users by their IDs for the given web log
let findNames webLogId (userIds: WebLogUserId list) = backgroundTask {
log.LogTrace "WebLogUser.findNames"
let idSql, idParams = inClause $"AND data ->> '{nameof WebLogUser.Empty.Id}'" "id" userIds
let idSql, idParams = inClause $"AND data->>'{nameof WebLogUser.Empty.Id}'" "id" userIds
let! users =
Custom.list
$"{selectWithCriteria Table.WebLogUser} {idSql}"