Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec Refactor #73

Merged
merged 7 commits into from
Dec 1, 2024
Merged

Spec Refactor #73

merged 7 commits into from
Dec 1, 2024

Conversation

AugustNagro
Copy link
Owner

@AugustNagro AugustNagro commented Nov 29, 2024

  • Spec.build method is removed. Specs are now fully declarative and the DbType is responsible for implementation.
  • Add Spec.prefix method
  • Change Spec.seek nullOrder, Spec.orderBy direction and nullOrder to be database Default
  • Tests are improved and now shared between database specs insteads of duplicated. The increased coverage exposed some tangential issues which are also resolved in this MR (see below). Note: switched from munit assertEquals -> assert until fix for Wrong line numbers using assertEquals when helper method declared in seperate file scalameta/munit#855 (comment) is released.

Additional changes:

  • No longer need to handle null when using DbCodec.biMap, or implementing DbCodec.readSingle
  • When implementing DbCodec, new method readSingleOption must be defined
  • Support optional products in outer-join queries (see test OptionalProductTests)
  • Switched to latest scalafmt version to prevent OOM in OracleTests
  • Make Frag, Query, Update, Returning into regular classes
  • Frag.returningKeys method which uses ResultSet.getGeneratedKeys
  • Make MySq insertReturning throw, since we shouldn't define multi-query repository methods unless they require DbTx.

Closes
#63
#62
#34

* Spec.build method is removed. Specs are now fully declarative and the DbType is responsible for implementation.
* Add Spec.prefix method
* Change Spec.seek nullOrder, Spec.orderBy direction and nullOrder to be database Default
* Tests are improved and now shared between database specs insteads of duplicated. The increased coverage exposed some tangential issues which are also resolved in this MR (see below). Note: switched from munit assertEquals -> assert until fix for scalameta/munit#855 (comment) is released.

Additional changes:

* No longer need to handle null when using DbCodec.biMap, or implementing DbCodec.readSingle
* When implementing DbCodec, new method readSingleOption must be defined
* Support optional products in outer-join queries (see test OptionalProductTests)
* Switched to latest scalafmt version to prevent OOM in OracleTests
* Make Frag, Query, Update, Returning into regular classes
* Frag.returningKeys method which uses ResultSet.getGeneratedKeys
* Make MySq insertReturning throw, since we shouldn't define 2-query repository methods.
@AugustNagro
Copy link
Owner Author

Merging now; please feel free to comment with any questions or suggestions, as this won't be released until v2.0.0

@AugustNagro AugustNagro merged commit a2334fd into master Dec 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant