Skip to content

Commit

Permalink
Fixed broken naming in Databases.View
Browse files Browse the repository at this point in the history
  • Loading branch information
b0wter committed Sep 28, 2020
1 parent 8bf2db7 commit 5f2544d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/lib/CouchDb.Lib.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<NuspecFile>b0wter.couchdb.nuspec</NuspecFile>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="Exception.fs" />
Expand Down
21 changes: 13 additions & 8 deletions src/lib/Databases/View.fs
Original file line number Diff line number Diff line change
Expand Up @@ -219,28 +219,33 @@ module View =
let query<'key, 'value> (props: DbProperties.T) (dbName: string) (designDoc: string) (view: string) =
queryWith<'key, 'value> props dbName designDoc view (Single EmptyQueryParameters)


/// Queries the given view of the design document and converts only the emitted keys to `'key`. The values are returned as `JObject`s.
let queryJObjectsWith<'key> (props: DbProperties.T) (dbName: string) (designDoc: string) (view: string) (queryParameters: QueryParameters) : Async<Result<'key, JObject>> =
jObjectsQuery<'key> props dbName designDoc view queryParameters
(*
/// Allows the definition of query parameters. These will be sent in the POST body (not as query parameters in a GET request).
let queryJObjectsWith<'key> (props: DbProperties.T) (dbName: string) (designDoc: string) (view: string) (queryParameters: QueryParameters) : Async<Result<'key, JObject>> =
async {
let! result = jObjectsQuery<'key> props dbName designDoc view queryParameters
return match result with
| Ok (r, _, _) -> Success r
| Error e -> mapError e
}
*)

/// Queries the given view of the design document and converts only the emitted keys to `'key`. The values are returned as `JObject`s.
/// Does not allow the definition of query parameters. Use `queryWith` instead.
let queryJObjects<'key> (props: DbProperties.T) (dbName: string) (designDoc: string) (view: string) : Async<Result<'key, JObject>> =
queryJObjectsWith<'key> props dbName designDoc view (QueryParameters.Single EmptyQueryParameters)

/// Runs `queryObjects` followed by `asResult`.
let queryObjectsAsResult props dbName designDoc view queryParameters =
let queryJObjectsWithAsResult props dbName designDoc view queryParameters =
queryJObjectsWith props dbName designDoc view queryParameters |> Async.map asResult


/// Runs `query` followed by `asResult`.
/// Runs `queryObjectsWith` followed by `asResult`.
let queryJObjectsAsResult props dbName designDoc view =
queryJObjectsWithAsResult props dbName designDoc view (QueryParameters.Single EmptyQueryParameters)

/// Runs `queryWith` followed by `asResult`.
let queryWithAsResult<'key, 'value> props dbName designDoc view queryParameters = queryWith<'key, 'value> props dbName designDoc view queryParameters |> Async.map asResult

/// Runs `query` followed by `asResult`.
let queryAsResult<'key, 'value> props dbName designDoc view = query<'key, 'value> props dbName designDoc view |> Async.map asResult

/// Returns all rows of a response in a single list.
Expand Down
13 changes: 10 additions & 3 deletions src/lib/b0wter.couchdb.nuspec.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<projectUrl>https://github.com/b0wter/CouchDb</projectUrl>
<license type="expression">GPL-3.0-only</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>%RELEASE_NOTES%</releaseNotes>
<releaseNotes>%RELEASE_NOTES%</releaseNotes>
<description>Easy to use library to talk to CouchDb from F#.</description>
<tags>database couchdb fsharp</tags>
<dependencies>
Expand All @@ -19,11 +19,18 @@
<dependency id="b0wter.FSharp" version="4.7.0" />
<dependency id="Newtonsoft.Json" version="12.0.2" />
</dependencies>
<contentFiles>
<files include="bin/Release/netstandard2.0/b0wter.CouchDb.xml" buildAction="content" flatten="true" copyToOutput="true"/>
</contentFiles>
<dependencies>
<group targetFramework=".netstandard2.0" />
</dependencies>
</metadata>
<files>
<file src="CouchDb.Lib.fsproj" target="src"/>
<file src="*.fs" target="src"/>
<file src="**/*.fs" target="src"/>
<file src="bin/Release/netstandard2.0/b0wter.CouchDb.dll" target="lib/netstandard2.0"/>
<file src="**/*.fs" target="src"/>
<file src="bin/Release/netstandard2.0/b0wter.CouchDb.dll" target="lib/netstandard2.0"/>
<file src="bin/Release/netstandard2.0/b0wter.CouchDb.xml" target="lib/netstandard2.0"/>
</files>
</package>

0 comments on commit 5f2544d

Please sign in to comment.