-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Add unit test for pagination #20
Conversation
Why cant I mark the PR as draft? |
Perhaps you can only create a draft when it is being opened. |
Shouldn't we include an empty page3? |
Ah... this will solve the issue |
Yes, we should be able to |
Seems that I cannot get the transaction log from |
Well, that's bad. Because it is hidden behind a dyn trait. |
Yes :( |
How about adding a feature gated |
Well, that's an official API, which would be another story. |
What's your plan on this? |
add the into_transaction_log method to the |
Then we have both |
It can be accessed via |
Hmmmm.... okay match db.get_connection() {
crate::DatabaseConnection::MockDatabaseConnection(mock_conn) => {
},
_ => unreachable!(),
}; |
I guess this is intensional. So that once we got the test cases setup we can run it directly on Postgres. sea-orm/src/database/connection.rs Line 60 in 97faaf0
|
See latest commit for transaction log checking |
Intentional. Just wanna try out different syntax to increase test coverage. |
Actually the test case can be run against any live & mock connection loll sea-orm/src/executor/paginator.rs Lines 355 to 384 in 7fa7463
|
How to refactor and improve the ergonomic for using the Mock API? |
What u mean? For example...
|
Yup, make the interface smooth |
Ok, will think about it |
Btw... we can explore the possibility to run our test cases against any real & mock connection E.g. type def a connection for all test cases to use |
I have created a Lines 27 to 38 in 5ef7c2d
Use it as follows sea-orm/src/executor/paginator.rs Lines 353 to 361 in 5ef7c2d
|
Both added |
Macro is not approved |
I guess u mean the derive macro Instead of using derive macro, we can... |
I mean both derive and |
Just to avoid boilerplate |
Will expand the macro then loll |
There must exist better ways to improve the ergonomic without using any macro |
Can we add a fn in MockDatabase? Take in any Statement and match it against first row of transaction_log i.e. calling Is this good? |
See latest commit |
Add support for the Postgres interval type
#5