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:
Additional Information
Related Issues / PRs
Motivation
Some web API enforce app state to be
Clonein particular, Axum, Rocket, etc. However, whenmockfeature is enabled on SeaORM, it will makeDatabaseConnectionnot 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
apiandcore, then we unit test thecoreand theapiis just a wrapper of thecore.Similar to what we did in StarfishQL:
core: https://github.com/SeaQL/starfish-ql/tree/main/starfish/starfish-coreapi: https://github.com/SeaQL/starfish-ql/tree/main/starfish/starfish-apiAdditional Information
Related Issues / PRs
DatabaseConnectionClonewith the default features enabled #438DatabaseConnectionalways deriveClone#665