Version 4 #6

Merged
danieljsummers merged 30 commits from version-four into main 2024-08-19 23:30:39 +00:00

Changes in this version:

  • BREAKING CHANGE: All *byField/*ByField functions are now *byFields/*ByFields, and take a FieldMatch case before the list of fields. The Compat namespace in both libraries will assist in this transition. In support of this change, the Field 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 modifiers by* that will combine the base query with the WHERE 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 like 8 and transform it to "8", this is no longer the case.
  • FEATURE: All Find queries (except byId/ById) now have a version with the Ordered suffix. These take a list of fields by which the query should be ordered. A new Field method called Named can 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); 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 the Compat namespace.
  • FEATURE: In the F# v3 library, lists of parameters were expected to be F#'s List type, and the C# version took either List<T> or IEnumerable<T>. In this version, these all expect seq/IEnumerable<T>. F#'s List satisfies the seq constraints, 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 same data column). F# users can use with to specify this at creation, and both F# and C# can use the WithQualifier method to create a field with the qualifier specified. Parameter names for fields may be specified in a similar way, substituting ParameterName for Qualifier.
Changes in this version: - **BREAKING CHANGE**: All `*byField`/`*ByField` functions are now `*byFields`/`*ByFields`, and take a `FieldMatch` case before the list of fields. The `Compat` namespace in both libraries will assist in this transition. In support of this change, the `Field` 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 modifiers `by*` that will combine the base query with the `WHERE` 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 like `8` and transform it to `"8"`, this is no longer the case. - **FEATURE**: All `Find` queries (except `byId`/`ById`) now have a version with the `Ordered` suffix. These take a list of fields by which the query should be ordered. A new `Field` method called `Named` can 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); 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 the `Compat` namespace. - **FEATURE**: In the F# v3 library, lists of parameters were expected to be F#'s `List` type, and the C# version took either `List<T>` or `IEnumerable<T>`. In this version, these all expect `seq`/`IEnumerable<T>`. F#'s `List` satisfies the `seq` 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 same `data` column). F# users can use `with` to specify this at creation, and both F# and C# can use the `WithQualifier` method to create a field with the qualifier specified. Parameter names for fields may be specified in a similar way, substituting `ParameterName` for `Qualifier`.
danieljsummers added 26 commits 2024-08-17 18:44:19 +00:00
- Add wrapper class for unnamed field parameters
- Support table qualifiers by field
- Support dot access to document fields/sub-fields
- Swap howMatched and fields throughout
- Existing tests pass; still need new ones for byFields
- This greatly reduces the duplicated functions needed
between F# and C#; F# lists satisfy the sequence reqs
- Add fieldNameParams/FieldNames to Postgres
(syncs names between both implementations)
- Alter whereById to expect a parameter
- WIP on PostgreSQL numeric ordering
- Rename tests, remove tested obsolete byField funcs
- Ignore "n:" prefix for SQLite fields
- Remove byFIeld functions
- Update package release notes
danieljsummers self-assigned this 2024-08-17 18:44:28 +00:00
danieljsummers added 1 commit 2024-08-18 21:23:16 +00:00
danieljsummers added 1 commit 2024-08-19 01:58:03 +00:00
- Move SQLite WithConn doc into Document module
danieljsummers added 1 commit 2024-08-19 23:17:59 +00:00
danieljsummers added 1 commit 2024-08-19 23:23:28 +00:00
danieljsummers merged commit 2c24e2e912 into main 2024-08-19 23:30:39 +00:00
danieljsummers deleted branch version-four 2024-08-19 23:30:39 +00:00
danieljsummers referenced this issue from a commit 2024-08-19 23:30:40 +00:00
Sign in to join this conversation.
No description provided.