-
-
Notifications
You must be signed in to change notification settings - Fork 476
Create tokio_postgres::Row
for unit tests.
#910
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
Comments
Row
for unit tests.tokio_postgres::Row
for unit tests.
The only way to create a Row is currently to query it from a Postgres instance. |
This was referenced Sep 13, 2022
hunts
pushed a commit
to hunts/rust-postgres
that referenced
this issue
Jan 5, 2023
Added RowDescription trait, and let rows to share the same description rather than having a copy in each row (think when there are thousand of them in the result). Added RowBuilder to support adding stubs of row data in unit tests. Currently, the library users have no chooice but have to use integration tests for testing Postgres data access code. With the changes in this commit, the `tokio-postgres` lib users can use RowBuilder to create sutbs to verify the deserialization from database result (Rows) to custom stucts in unit tests. It can also serves as a base for future implementation of certain kind of mocks of the db connection. Related-to sfackler#910 sfackler#950
hunts
added a commit
to hunts/rust-postgres
that referenced
this issue
Jan 5, 2023
Added RowDescription trait, and let rows to share the same description rather than having a copy in each row (think when there are thousand of them in the result). Added RowBuilder to support adding stubs of row data in unit tests. Currently, the library users have no chooice but have to use integration tests for testing Postgres data access code. With the changes in this commit, the `tokio-postgres` lib users can use RowBuilder to create sutbs to verify the deserialization from database result (Rows) to custom stucts in unit tests. It can also serves as a base for future implementation of certain kind of mocks of the db connection. Related-to sfackler#910 sfackler#950
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Greetings!
Any way to create
tokio_postgres::Row
for unit-tests?The text was updated successfully, but these errors were encountered: