sea-orm
sea-orm copied to clipboard
[examples] Demonstrate how to mock test SeaORM's CURD operations on common web APIs
Motivation
Some web API enforce app state to be Clone
in particular, Axum, Rocket, etc. However, when mock
feature is enabled on SeaORM, it will make DatabaseConnection
not cloneable. And this cause trouble for users who want to mock test their web API endpoints.
Proposed Solutions
Separating the API into two standalone crates namely api
and core
, then we unit test the core
and the api
is just a wrapper of the core
.
Similar to what we did in StarfishQL:
-
core
: https://github.com/SeaQL/starfish-ql/tree/main/starfish/starfish-core -
api
: https://github.com/SeaQL/starfish-ql/tree/main/starfish/starfish-api
Additional Information
Related Issues / PRs
- https://github.com/SeaQL/sea-orm/issues/438
- https://github.com/SeaQL/sea-orm/pull/665
- https://github.com/SeaQL/sea-orm/pull/698
@tyt2y3 thoughts?
Hey @shpun817, would you like to take on this?
Hey @shpun817, would you like to take on this?
Okay!