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

Force typing for Postgresql::date_trunc so it can be used in a condition #415

Merged
merged 3 commits into from
Mar 9, 2024
Merged

Force typing for Postgresql::date_trunc so it can be used in a condition #415

merged 3 commits into from
Mar 9, 2024

Conversation

florentdestremau
Copy link
Contributor

I had the use case today to use date_trunc inside a query builder ->where statement and the lexer was lost because of an error like this:

An exception occurred while executing a query: SQLSTATE[42725]: Ambiguous function: 7 ERROR: function date_trunc(unknown, unknown) is not unique
LINE 1: ...pany_id = $1 AND DATE_TRUNC($2, p1_.created_at) = DATE_TRUNC...

This simple solution ensures postgresql knows what to expect.

@florentdestremau
Copy link
Contributor Author

up @beberlei if you have time for this

@connorhu
Copy link
Contributor

connorhu commented Mar 4, 2024

@florentdestremau Can you please make a rebase? Since your PR, a couple of CI checks have been included, it would be nice to see the results of those.

@florentdestremau
Copy link
Contributor Author

I just rebased on master ! It seems like you need to approve the build run

@connorhu
Copy link
Contributor

connorhu commented Mar 4, 2024

@derrabus Can you please approve the workflow? Thank you!

@derrabus
Copy link
Collaborator

derrabus commented Mar 5, 2024

Sure.

@florentdestremau
Copy link
Contributor Author

I fixed the codestyle, the tests should all pass by now

@greg0ire greg0ire requested a review from derrabus March 9, 2024 10:43
@derrabus derrabus merged commit 40e117a into beberlei:master Mar 9, 2024
10 checks passed
@florentdestremau florentdestremau deleted the feature/add-datetrunc-typing branch March 11, 2024 07:36
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.

6 participants