Skip to content

Commit

Permalink
3.0.0 (#440)
Browse files Browse the repository at this point in the history
* Adds compare execution option

* Formatting code

* Removing more filters, fixing test impact

* fixing tests impacted by change in default `compare` value

* Lifts and shifts "conversions"

* Working tests

* Working execution option `compare`

* Simplifies `validate` api

* Updates documentation to with impact of `compare` execution option changes

* Fixing tests and removing `raw:true` and `includeKeys:true`

* Updates rough changelog

* Tidies documentation

* Documentation updates

* Fixes `response` return logic for delete
The `default` option value did not provide the same experience as omitting the option.

* Rough changelog updates

* Fixes `delete` response type tests

* Documentation clean up

* Polish
- Finishing touches to CHANGELOG.md
- Prettier formatting
- Adding "Upgrade to v3" menu

* Updating page sections for language diversity

* Pages updates

* Page updates

* Page updates

* Adds undefined `compare` tests, removes skipped validation tests
  • Loading branch information
tywalch authored Oct 20, 2024
1 parent 04dca9e commit a1dd279
Show file tree
Hide file tree
Showing 60 changed files with 8,544 additions and 1,878 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,14 @@ All notable changes to this project will be documented in this file. Breaking ch
## [2.15.0] - 2024-09-19
### Updated
- Updated `@aws-sdk/lib-dynamodb` dependency from pinned version `3.395.0` to latest release `^3.654.0`. This impacts users using the v3 aws-sdk.
- Adds dependency `@aws-sdk/util-dynamodb` for unmarshalling functionality.
- Adds dependency `@aws-sdk/util-dynamodb` for unmarshalling functionality.

## [3.0.0]
### Changed
- ElectroDB is changing how it generates query parameters to give more control to users. Prior to `v3`, query operations that used the `gt`, `lte`, or `between` methods would incur additional post-processing, including additional filter expressions and some sort key hacks. The post-processing was an attempt to bridge an interface gap between attribute-level considerations and key-level considerations. Checkout the GitHub issue championed by @rcoundon and @PaulJNewell77 [here](https://github.com/tywalch/electrodb/issues/228) to learn more. With `v3`, ElectroDB will not apply post-processing to queries of any type and abstains from adding implicit/erroneous filter expressions to queries _by default_. This change should provide additional control to users to achieve more advanced queries, but also introduces some additional complexity. There are many factors related to sorting and using comparison queries that are not intuitive, and the simplest way to mitigate this is by using additional [filter expressions](https://electrodb.dev/en/queries/filters/) to ensure the items returned will match expectations. To ease migration and adoption, I have added a new execution option called `compare`; To recreate `v2` functionality without further changes, use the execution option `{ compare: "v2" }`. This value is marked as deprecated and will be removed at a later date, but should allow users to safely upgrade to `v3` and experiment with the impact of this change on their existing data. The new `compare` option has other values that will continue to see support, however; to learn more about this new option, checkout [Comparison Queries](https://electrodb.dev/en/queries/query#comparison-queries).
- The `validate` callback on attributes now expects a strict return type of `boolean`. Additionally, the semantic meaning of a boolean response has _flipped_. The callback should return `true` for "valid" values and `false` for "invalid" values. If your validation function throws an error, ElectroDB will still behave as it previously did in `v2`, by catching and wrapping the error.
- Providing the execution option `limit` on queries now _only_ applies a `Limit` parameter to its request to DynamoDB. Previously, the `limit` option would cause ElectroDB to effectively "seek" DynamoDB until the limit was _at least_ reached. The execution option `count` can be used in similar cases where `limit` was used, but performance may vary depending on your data and use case.
### Removed
- The execution options `includeKeys` and `raw` were deprecated in version `2.0.0` and have now been removed in favor of the execution option `data`. To migrate from `v2`, use the options `{ data: "includeKeys" }` and `{ data: "raw" }` respectively.
### Fixed
- Response typing and formatting logic for `delete`
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@

_Please submit issues/feedback or reach out on Twitter [@tinkertamper](https://twitter.com/tinkertamper)._

<a href="https://electrodb.dev/en/core-concepts/v3-migration/"><h1 align="center">ElectroDB v3 now released</h1></a>

<p align="center">Visit the <a href="https://electrodb.dev/en/core-concepts/v3-migration/">v3 migration page</a> to learn more about this new update.</p>

---

<a href="https://electrodb.dev"><h1 align="center">New: Documentation now found at ElectroDB.dev</h1></a>
<a href="https://electrodb.dev"><h1 align="center">Documentation now found at ElectroDB.dev</h1></a>

<p align="center">ElectroDB's new website for Documentation is now live at <a href="https://electrodb.dev">www.ElectroDB.dev</a>.</p>
<p align="center">ElectroDB's new website for Documentation is now live at <a href="https://electrodb.dev">electrodb.dev</a>.</p>

---

<a href="https://electrodb.fun"><h1 align="center">Introducing: The NEW ElectroDB Playground</h1></a>
<a href="https://electrodb.fun"><h1 align="center">The NEW ElectroDB Playground</h1></a>

<p align="center">
<a href="https://electrodb.fun"><img width="400" src="https://github.com/tywalch/electrodb/blob/master/assets/playground.jpg?raw=true"></a>
Expand Down
Loading

0 comments on commit a1dd279

Please sign in to comment.