-
Version 4 (RC 5) Pre-Release
released this
2024-09-18 13:39:05 +00:00 | 0 commits to main since this releaseThis is an API bug-fix for rc4, which allows any
IEnumerable<T>
(C#) /seq<'T>
(F#) to be provided toField.In
andField.InArray
transparently. That was the intent of these functions, but their rc4 definitions required existing sequences to have each item cast toobject
/obj
; this should no longer be required.Downloads
-
Version 4 (RC 4) Pre-Release
released this
2024-09-17 02:41:38 +00:00 | 1 commits to main since this releaseChanges from rc3 include:
In
andInArray
comparisons forField
s allow for retrieving documents where certain items match a given set of values- The
Op
type was replaced with theComparison
type; this was an internal API, but the type was public.Comparison
is based on an F# discriminated union, which improves the type safety of field comparisons, but can be verbose to work with from C#. Field
constructor functions are now spelled out (ex.EQ
is nowEqual
). The shorter versions exist as aliases.
Version 4 is thought to be feature-complete with this release. Barring any unexpected bugs, a non-RC release should be forthcoming by the end of October 2024.
Downloads
-
Version 4 (RC 3) Pre-Release
released this
2024-09-17 02:31:12 +00:00 | 2 commits to main since this releaseThis is a bug-fix for rc2 which preserves extra qualifiers after
ASC
orDESC
in an ordered field definition. This allows for specifying case insensitive searches,NULLS FIRST
orNULLS LAST
, etc.This was released August 22nd, but was not tagged at the time
Downloads
-
Version 4 (RC 2) Pre-Release
released this
2024-08-23 00:24:26 +00:00 | 3 commits to main since this releaseThis release has one change from rc1:
- Prefixing fields by
i:
(lowercase "I" for "insensitive") in a list of ordering fields will force the sorting to be done in a case-insensitive manner. By default, PostgreSQL may sort this way already (but does not on Macintosh hosts), but SQLite will sort capital letters ahead of lowercase letters.
If upgrading from v3, be sure to check out the rc1 list for the changes in this release.
Downloads
- Prefixing fields by
-
Version 4 (RC 1) Pre-Release
released this
2024-08-19 23:39:14 +00:00 | 5 commits to main since this releaseVersion 4 is an evolution of this library to support better types (including treating numbers as numbers), generate IDs for documents, and support both queries on multiple fields and order of results without having to resort to custom SQL. This did bring some breaking changes, but there is also a
Compat
namespace that can be used to soften some of those to deprecation warnings, allowing you to upgrade without breaking the build.The migration guide is a work-in-progress at the time of this release, but will be fully fleshed out before v4 is released for good. The remainder of the documentation at that site has been updated for version 4, including configuring automatic IDs and ordering query results.
From the v4 pull request, a slightly-organized list of features and breaking changes:
- BREAKING CHANGE: All
*byField
/*ByField
functions are now*byFields
/*ByFields
, and take aFieldMatch
case before the list of fields. TheCompat
namespace in both libraries will assist in this transition. In support of this change, theField
parameter name is optional; the library will generate parameter names for it if they are not specified. - BREAKING CHANGE: The
Query
namespaces have had some significant work, particularly from the full-query perspective. Most have been broken up into the base query and modifiersby*
that will combine the base query with theWHERE
clause needed to satisfy the criteria. - FEATURE / BREAKING CHANGE: PostgreSQL document fields will now be cast to numeric if the parameter value passed to the query is numeric. This drove the
Query
breaking changes, as the fields need to have their intended value for the library to generate the appropriate SQL. Additionally, if code assumes the library can be given something like8
and transform it to"8"
, this is no longer the case. - FEATURE: All
Find
queries (exceptbyId
/ById
) now have a version with theOrdered
suffix. These take a list of fields by which the query should be ordered. A newField
method calledNamed
can assist with creating these fields. Prefixing the field name withn:
will cast the field to numeric in PostgreSQL (and will be ignored by SQLite); adding " DESC" to the field name will sort it descending (Z-A, high to low) instead of ascending (A-Z, low to high). - FEATURE: The library can now generate IDs for documents. It can generate a "max-plus-1" for numeric IDs, GUID strings, or random hexadecimal strings of a configurable length.
- BREAKING CHANGE (PostgreSQL only):
fieldNameParam
/Parameters.FieldName
are now plural. The function still only generates one parameter, but the name is now the same between PostgreSQL and SQLite. The goal of this library is to abstract the differences away as much as practical, and this furthers that end. There are functions with these names in theCompat
namespace. - FEATURE: In the F# v3 library, lists of parameters were expected to be F#'s
List
type, and the C# version took eitherList<T>
orIEnumerable<T>
. In this version, these all expectseq
/IEnumerable<T>
. F#'sList
satisfies theseq
constraints, so this should not be a breaking change. - FEATURE:
Field
s now may have qualifiers; this allows tables to be aliased when joining multiple tables (as all have the samedata
column). F# users can usewith
to specify this at creation, and both F# and C# can use theWithQualifier
method to create a field with the qualifier specified. Parameter names for fields may be specified in a similar way, substitutingParameterName
forQualifier
.
Downloads
- BREAKING CHANGE: All
-
Version 3.1 Stable
released this
2024-06-06 01:58:08 +00:00 | 7 commits to main since this releaseThis release brings a new
BT
operator and correspondingField.BT
function/method to create those criteria. This change mandated thatwhereByField
be moved out of the common library, as PostgreSQL needs different syntax to useBETWEEN
against numeric values once the item is plucked from the JSON document. This mandated thatwhereById
be moved as well, which then cascaded to most of theQuery
module queries. If your program uses these functions, and it cannot find them,open
orusing
the implementation-specific module. (#4)This release also drops support for .NET 7, which went end-of-life on May 14, 2024. (#3)
Finally, all dependencies for these libraries were brought current.
Downloads
-
Version 3 Stable
released this
2024-04-21 03:05:06 +00:00 | 11 commits to main since this releaseThis is the official release of version 3 - no more RCs! The API has been stable, and these libraries have been implemented in several projects successfully.
NOTE: This replaces
BitBadger.Npgsql.Documents
andBitBadger.Npgsql.FSharp.Documents
. The namespace for PostgreSQL isBitBadger.Documents.Postgres
, and both C# and F# syntax is contained in that namespace. A migration guide is available at the prior project site.Downloads
-
v3 (RC 2) Pre-Release
released this
2024-01-24 02:23:24 +00:00 | 21 commits to main since this releaseRelease Candidate 2
- Uses
Field
type for by-field queries (BREAKING)
For by-field queries using RC 1, the functions required three parameters: the field name, an operator, and a value. The query building functions took just the name and operator, and the parameter building functions required just the name and value. Now, there is a
Field
type for this criteria, and it incorporates all three items. It has functions to create these easily, and they follow the form ofField.OP(name, value)
. (EX
andNEX
require no value.)This is a breaking change; what used to be three parameters (
"FieldName" EQ 22
) is now a function call (Field.EQ("FieldName", 22)
in C# or(Field.EQ "FieldName" 22)
in F#). Also, thoughvalue
is defined asobj
/object
, PostgreSQL only recognizes string values; SQLite allows strings, numbers, and boolean values.- Adds
RemoveFields*
functions
While the
Patch*
functions can be used to update portions of documents (including setting fields tonull
), if the calling application has the JSON serializer set to ignorenull
values, thenull
field is removed from the patch document, so the destination document is not updated. While a full update would replace the document, a better option here is to remove the fields from the document. These functions take anIEnumerable<string>
(C#) orstring list
(F#) as their final parameter, and will remove the specified fields from the matching documents (by-ID, by-field for both, by-contains and by-JSON-path for PostgreSQL). (If using .NET 8/C# 12, this is a great place for the new collection syntax[ "Field1", "Field2" ]
.)
Packages are available on NuGet.
Downloads
- Uses