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

COALESCE missing in MySQL #158

Closed
kblomster opened this issue Jun 2, 2022 · 3 comments · Fixed by #159
Closed

COALESCE missing in MySQL #158

kblomster opened this issue Jun 2, 2022 · 3 comments · Fixed by #159
Labels
bug Something isn't working
Milestone

Comments

@kblomster
Copy link
Contributor

kblomster commented Jun 2, 2022

Describe the bug
The postgres dialect exports COALESCE in postgres/functions.go, but the MySQL dialect lacks it. It's a pretty ubiquitous function, so I believe this is probably a bug.

Code snippet

q := Film.SELECT(
    Film.Title,
    IntExp(COALESCE(Film.Length, Int(0))).AS("length_not_null")
)

Expected behavior
I expect COALESCE to be available the MySQL dialect.

As a minor feature request, I think it'd be pretty nice to have the functions listed somewhere on the wiki. Some of them are already on the "Expressions" page, and to be fair a lot of them are just the exact same keywords as in SQL, but when you're new to the library it really helps to just know for sure that they do exist (and especially so when it comes to Jet-specific variants like SUMf() - it shows up in examples, but again, a reference would be nice).

Having typed this out I now realize that in the time it took I could just have submitted a PR instead. :/

@kblomster kblomster added the bug Something isn't working label Jun 2, 2022
@go-jet
Copy link
Owner

go-jet commented Jun 4, 2022

Hi @kblomster . Yeah, it seems those functions are missing for MySQL.
Wiki update PR also welcomed.

@go-jet
Copy link
Owner

go-jet commented Jun 4, 2022

Hmm, it looks like they are missing for SQLite as well.

@go-jet go-jet mentioned this issue Sep 30, 2022
@go-jet go-jet added this to the Version 2.9.0 milestone Sep 30, 2022
@go-jet
Copy link
Owner

go-jet commented Sep 30, 2022

Fixed with 2.9.0 release.

@go-jet go-jet closed this as completed Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants