Update for v4-rc5 of doc library

This commit is contained in:
2024-09-18 19:54:45 -04:00
parent 0032d15c0a
commit 870f87cb17
11 changed files with 15 additions and 22 deletions

View File

@@ -43,7 +43,6 @@ type PostgresCategoryData(log: ILogger) =
|> Seq.filter (fun cat -> cat.ParentNames |> Array.contains it.Name)
|> Seq.map _.Id
|> Seq.append (Seq.singleton it.Id)
|> Seq.map box
|> Field.InArray (nameof Post.Empty.CategoryIds) Table.Post
let query =
(Query.statementWhere

View File

@@ -111,8 +111,7 @@ type PostgresPageData(log: ILogger) =
log.LogTrace "Page.findCurrentPermalink"
if List.isEmpty permalinks then return None
else
let linkField =
Field.InArray (nameof Page.Empty.PriorPermalinks) Table.Page (List.map (string >> box) permalinks)
let linkField = Field.InArray (nameof Page.Empty.PriorPermalinks) Table.Page (List.map string permalinks)
let query =
(Query.statementWhere
(Query.find Table.Page)

View File

@@ -97,8 +97,7 @@ type PostgresPostData(log: ILogger) =
log.LogTrace "Post.findCurrentPermalink"
if List.isEmpty permalinks then return None
else
let linkField =
Field.InArray (nameof Post.Empty.PriorPermalinks) Table.Post (List.map (string >> box) permalinks)
let linkField = Field.InArray (nameof Post.Empty.PriorPermalinks) Table.Post (List.map string permalinks)
let query =
(Query.statementWhere
(Query.find Table.Post)
@@ -121,7 +120,7 @@ type PostgresPostData(log: ILogger) =
/// Get a page of categorized posts for the given web log (excludes revisions)
let findPageOfCategorizedPosts webLogId (categoryIds: CategoryId list) pageNbr postsPerPage =
log.LogTrace "Post.findPageOfCategorizedPosts"
let catIdField = Field.InArray (nameof Post.Empty.CategoryIds) Table.Post (List.map (string >> box) categoryIds)
let catIdField = Field.InArray (nameof Post.Empty.CategoryIds) Table.Post (List.map string categoryIds)
Custom.list
$"""{selectWithCriteria Table.Post}
AND {Query.whereByFields All [ catIdField ]}

View File

@@ -6,7 +6,6 @@ open Microsoft.Extensions.Logging
open MyWebLog
open MyWebLog.Data
open Npgsql.FSharp
open Npgsql.Internal.Postgres
/// PostgreSQL myWebLog tag mapping data implementation
type PostgresTagMapData(log: ILogger) =
@@ -39,7 +38,7 @@ type PostgresTagMapData(log: ILogger) =
/// Find any tag mappings in a list of tags for the given web log
let findMappingForTags (tags: string list) webLogId =
log.LogTrace "TagMap.findMappingForTags"
let tagField = Field.InArray (nameof TagMap.Empty.Tag) Table.TagMap (List.map box tags)
let tagField = Field.InArray (nameof TagMap.Empty.Tag) Table.TagMap tags
Custom.list
$"{selectWithCriteria Table.TagMap} AND {Query.whereByFields All [ tagField ]}"
(addFieldParams [ tagField ] [ webLogContains webLogId ])

View File

@@ -55,7 +55,7 @@ type PostgresWebLogUserData(log: ILogger) =
/// 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 idField = Field.In (nameof WebLogUser.Empty.Id) (List.map (string >> box) userIds)
let idField = Field.In (nameof WebLogUser.Empty.Id) (List.map string userIds)
let! users =
Custom.list
$"{selectWithCriteria Table.WebLogUser} AND {Query.whereByFields All [ idField ]}"