Closed AshMcConnell closed 4 months ago
Ah, the rubber 🦆 strikes again.
I realised that ExpectQuery uses a regex to match. I'll figure out how to escape the * (and perhaps the $?)
EDIT - For googlers yep, I used SELECT (.+) FROM race_stats.thing WHERE id = (.+)
and it works as expected! Onwards and upwards!
Thanks! Ash
You can change how you match a query. You can even write your own matcher :)
Fancy! 😂 Thanks!
Hi @pashagolub
Sorry, I am a bit of a newbie to Go and to pgxmock. I can't seem to get it to return any rows.
Here is the function I am testing:-
Here is my test function: -
I've debugged and rows is always returning nil. I've tried wrapping it in a ExpectBegin / ExpectCommit, but no luck. Is it not matching the SQL / args or am I doing something else wrong?
Thanks for your help! Ash