-
Version 4.1 Stable
released this
2025-04-19 20:05:15 +00:00 | 0 commits to main since this releaseFEATURE - The new
Jsonmodule/static class allows documents to be retrieved as JSON. The functions/methods are the same as theFindmodule/static class, and return a string. There are also functions that begin withWrite(C#) /write(F#) which write the JSON to aPipeWriteras it arrives. For JSON API servers, this allows documents to be retrieved and streamed to the output without having to create domain objects or an in-memory string of all of them.DOCUMENTATION - The documentation for this site is now built with docfx ("Documentation Framework"), a project which can extract the API docs (delivered in 4.0.1) and create nice, browsable web pages. It also supports hand-written documentation, and creates a set of files which can be dropped anywhere and served as-is. For this project, these are now served at https://relationaldocs.bitbadger.solutions/dotnet/. The parent level of that website also now has a lot of information on the concepts behind document storage, impartial evaluations of their pros and cons, and more.
POSSIBLE BREAKING CHANGE -
Custom.Singleused to run whatever query it was given and return the first result. However, this meant that large queries could be retrieved, deserialized, collected into a list - and then be immediately discarded. This function now addsLIMIT 1to the end of the query before it is executed, returning only the rows necessary to satisfy the request. This was a mostly-internal API, though if you have queries where you have specifically added this clause, you can remove it.Downloads
-
Version 4.0.1 Stable
released this
2024-12-30 22:05:49 +00:00 | 1 commits to main since this releaseIn this release, full XML documentation is generated and packaged along with the code. IDEs should provide more help with classes, functions, and parameters than they have in previous releases.
(NOTE: v4 contained some breaking changes; see its release notes for more information.)
Downloads
-
Version 4 Stable
released this
2024-12-18 04:01:51 +00:00 | 2 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
Compatnamespace that can be used to soften some of those to deprecation warnings, allowing you to upgrade without breaking the build. The migration guide details these changes, and the documentation there has been updated for version 4, including configuring automatic IDs and ordering query results.Library Changes
- 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: All
*byField/*ByFieldfunctions are now*byFields/*ByFields, and take aFieldMatchcase before the list of fields. TheCompatnamespace in both libraries will assist in this transition. In support of this change, theFieldparameter name is optional; the library will generate parameter names for it if they are not specified.
v3 example:
var result = Find.ByField("customer", Field.EQ("name", "john"));v4 equivalent:
var result = Find.ByFields("customer", FieldMatch.Any, [Field.Equal("name", "john")]);- BREAKING CHANGE: PostgreSQL document fields will now be cast to numeric if the parameter value passed to the query is numeric. This drove the
Querybreaking 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 like8and transform it to"8", this is no longer the case. - All
Findqueries (exceptbyId/ById) now have a version with theOrderedsuffix. These take a list of fields by which the query should be ordered. A newFieldmethod calledNamedcan assist with creating these fields.- Prefixing the field name with
n:will cast the field to numeric in PostgreSQL (and will be ignored by SQLite). - 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. - Adding " DESC" to the field name will sort it descending (Z-A, high to low) instead of ascending (A-Z, low to high). Additionally, other ordering directives, such as
NULLS LAST, can appear after the field name (ex.Field.Named("i:last_name DESC NULLS FIRST")will do a case-insensitive sort descending, with nulls ahead of any present values).
- Prefixing the field name with
- In the F# v3 library, lists of parameters were expected to be F#'s
Listtype, and the C# version took eitherList<T>orIEnumerable<T>. In this version, these all expectseq/IEnumerable<T>. F#'sListsatisfies theseqconstraints, so this should not be a breaking change. InandInArraycomparisons forFields allow for retrieving documents where certain items match a given set of values.Fieldconstructor functions are now spelled out (ex.EQis nowEqual). The shorter versions exist as aliases, but these aliases are planned for deprecation in version 4.1.
Query Building Features
For those who like to go deeper and make their own queries, some of these internal APIs changed significantly.
- BREAKING CHANGE: The
Optype was replaced with theComparisontype; this was an internal API, but the type was public.Comparisonis based on an F# discriminated union, which improves the type safety of field comparisons, but can be verbose to work with from C#. - BREAKING CHANGE: The
Querynamespaces 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 theWHEREclause needed to satisfy the criteria. - BREAKING CHANGE (PostgreSQL only):
fieldNameParam/Parameters.FieldNameare 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 theCompatnamespace. Fields now may have qualifiers; this allows tables to be aliased when joining multiple tables (as all have the samedatacolumn). F# users can usewithto specify this at creation, and both F# and C# can use theWithQualifiermethod to create a field with the qualifier specified. Parameter names for fields may be specified in a similar way, substitutingParameterNameforQualifier.
Downloads
-
Version 4 (RC 5) Pre-Release
released this
2024-09-18 13:39:05 +00:00 | 3 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.InandField.InArraytransparently. 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 | 4 commits to main since this releaseChanges from rc3 include:
InandInArraycomparisons forFields allow for retrieving documents where certain items match a given set of values- The
Optype was replaced with theComparisontype; this was an internal API, but the type was public.Comparisonis based on an F# discriminated union, which improves the type safety of field comparisons, but can be verbose to work with from C#. Fieldconstructor functions are now spelled out (ex.EQis 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 | 5 commits to main since this releaseThis is a bug-fix for rc2 which preserves extra qualifiers after
ASCorDESCin an ordered field definition. This allows for specifying case insensitive searches,NULLS FIRSTorNULLS 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 | 6 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 | 8 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
Compatnamespace 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/*ByFieldfunctions are now*byFields/*ByFields, and take aFieldMatchcase before the list of fields. TheCompatnamespace in both libraries will assist in this transition. In support of this change, theFieldparameter name is optional; the library will generate parameter names for it if they are not specified. - BREAKING CHANGE: The
Querynamespaces 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 theWHEREclause 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
Querybreaking 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 like8and transform it to"8", this is no longer the case. - FEATURE: All
Findqueries (exceptbyId/ById) now have a version with theOrderedsuffix. These take a list of fields by which the query should be ordered. A newFieldmethod calledNamedcan 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.FieldNameare 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 theCompatnamespace. - FEATURE: In the F# v3 library, lists of parameters were expected to be F#'s
Listtype, and the C# version took eitherList<T>orIEnumerable<T>. In this version, these all expectseq/IEnumerable<T>. F#'sListsatisfies theseqconstraints, so this should not be a breaking change. - FEATURE:
Fields now may have qualifiers; this allows tables to be aliased when joining multiple tables (as all have the samedatacolumn). F# users can usewithto specify this at creation, and both F# and C# can use theWithQualifiermethod to create a field with the qualifier specified. Parameter names for fields may be specified in a similar way, substitutingParameterNameforQualifier.
Downloads
- BREAKING CHANGE: All
-
Version 3.1 Stable
released this
2024-06-06 01:58:08 +00:00 | 10 commits to main since this releaseThis release brings a new
BToperator and correspondingField.BTfunction/method to create those criteria. This change mandated thatwhereByFieldbe moved out of the common library, as PostgreSQL needs different syntax to useBETWEENagainst numeric values once the item is plucked from the JSON document. This mandated thatwhereByIdbe moved as well, which then cascaded to most of theQuerymodule queries. If your program uses these functions, and it cannot find them,openorusingthe 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 | 14 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.DocumentsandBitBadger.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