Skip to content

Let assertQuery support update queries - #149

Merged
stephencelis merged 2 commits into
pointfreeco:mainfrom
rcarver:assert-query-writable
Sep 2, 2025
Merged

stephencelis merged 2 commits into
pointfreeco:mainfrom
rcarver:assert-query-writable

Conversation

@rcarver

@rcarver rcarver commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

This tweaks the new assertQuery to use DatabaseWriter and database.write to perform the query. This allows assertions over UPDATE ... RETURNING queries which can be handy to test complex update logic.

Curious if using write is expected/ok here. Should there be a more explicit way to opt into it? Since defaultDatabase is DatabaseWriter it was otherwise a seamless change.

Apologies for missing this on the first version! I found that I was doing update assertions in some of my libraries after updating to 0.7.0

@stephencelis stephencelis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@stephencelis
stephencelis merged commit ec6eed5 into pointfreeco:main Sep 2, 2025
5 checks passed
@rcarver
rcarver deleted the assert-query-writable branch September 2, 2025 17:16
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

Successfully merging this pull request may close these issues.

2 participants