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

Misuse of SpiClient::select in some tests #529

Closed
syvb opened this issue Sep 7, 2022 · 1 comment
Closed

Misuse of SpiClient::select in some tests #529

syvb opened this issue Sep 7, 2022 · 1 comment

Comments

@syvb
Copy link
Member

syvb commented Sep 7, 2022

The documentation for SpiClient::select/SpiClient::update says that select should be used for operations that only read, and update should be used for operations that write. Currently all of our tests use select for all queries, even those that write to the database. The queries that write should be changed to use update.

This isn't much of a problem currently since select and update have the same implementations, but in future versions of pgx using select to modify the database might not work.

@syvb
Copy link
Member Author

syvb commented Apr 5, 2023

We fixed this in d498dc6 by replacing all uses of SpiClient::select with SpiClient::update. (Ideally we would still use select for read-only queries, but right now we only use SPI in tests so it's not very important.)

@syvb syvb closed this as completed Apr 5, 2023
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

No branches or pull requests

1 participant