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

prepared statements with colon not working #1719

Open
cfurst opened this issue Jul 26, 2022 · 2 comments
Open

prepared statements with colon not working #1719

cfurst opened this issue Jul 26, 2022 · 2 comments

Comments

@cfurst
Copy link

cfurst commented Jul 26, 2022

Hello,
I'm basically trying to match parts of dates using text comparisons. Like so:

Select * from table where text(timestamptzfield) LIKE '%20:36%'

It works in PgAdmin, and the expected rows are returned. However when I try it with doobie using a fr clause like so:

fr"text(timestamptzfield) LIKE ${s"%$searchValue%"}"

where searchValue = "20:36", no rows are returned.

I've debugged as much as I could, and it looks like it's working, I see the right strings, but it's returning no values form the postgreSQL db.

This works without a colon so If I use, say, searchValue = 20 the proper rows are returned. Any help would be appreciated.

Thanks!

@jatcwang
Copy link
Collaborator

Hmm yeah that's weird. Don't think Doobie is involved here. Can you try using raw JDBC to reproduce this issue?

@cfurst
Copy link
Author

cfurst commented Jul 26, 2022

Thanks for the quick reply.

Will try to reproduce. Thank you.

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

2 participants