![]() |
VOOZH | about |
dotnet add package BitBadger.Npgsql.FSharp.Documents --version 2.0.0
NuGet\Install-Package BitBadger.Npgsql.FSharp.Documents -Version 2.0.0
<PackageReference Include="BitBadger.Npgsql.FSharp.Documents" Version="2.0.0" />
<PackageVersion Include="BitBadger.Npgsql.FSharp.Documents" Version="2.0.0" />Directory.Packages.props
<PackageReference Include="BitBadger.Npgsql.FSharp.Documents" />Project file
paket add BitBadger.Npgsql.FSharp.Documents --version 2.0.0
#r "nuget: BitBadger.Npgsql.FSharp.Documents, 2.0.0"
#:package BitBadger.Npgsql.FSharp.Documents@2.0.0
#addin nuget:?package=BitBadger.Npgsql.FSharp.Documents&version=2.0.0Install as a Cake Addin
#tool nuget:?package=BitBadger.Npgsql.FSharp.Documents&version=2.0.0Install as a Cake Tool
This package provides a set of functions that provide a document database interface to a data store backed by PostgreSQL. This library is targeted toward F# usage; for C#, see BitBadger.Npgsql.Documents.
Task-based async for all data access functionsThe main step is to set the data source with which the library will create connections. Construct an NpgsqlDataSource instance, and provide it to the library:
open BitBadger.Npgsql.FSharp.Documents
// ...
let dataSource = // ....
Configuration.useDataSource dataSource
// ...
By default, the library uses a System.Text.Json-based serializer configured to use the FSharp.SystemTextJson converter. To provide a different serializer (different options, more converters, etc.), construct it to implement IDocumentSerializer and provide it via Configuration.useSerializer. If custom serialization makes the serialized Id field not be Id, that will also need to be configured.
Retrieve all customers:
// parameter is table name
// returns Task<Customer list>
let! customers = all<Customer> "customer"
Select a customer by ID:
// parameters are table name and ID
// returns Task<Customer option>
let! customer = Find.byId<Customer> "customer" "123"
Count customers in Atlanta:
// parameters are table name and object used for JSON containment query
// return Task<int>
let! customerCount = Count.byContains "customer" {| City = "Atlanta" |}
Delete customers in Chicago: (no offense, Second City; just an example...)
// parameters are table name and JSON Path expression
do! Delete.byJsonPath "customer" """$.City ? (@ == "Chicago")"""
The project site has full details on how to use this library.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on BitBadger.Npgsql.FSharp.Documents:
| Package | Downloads |
|---|---|
|
BitBadger.Npgsql.Documents
Lightweight functions to use PostgreSQL as a document store (best for C#) |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 561 | 12/2/2023 |
| 1.0.0 | 421 | 10/12/2023 |
| 1.0.0-beta3 | 480 | 6/28/2023 |
| 1.0.0-beta2 | 495 | 2/24/2023 |
| 1.0.0-beta | 436 | 2/20/2023 |
- BREAKING CHANGE: Remove ID column from database and from several function calls
- FEATURE: Support .NET 8