X Tutup
The Wayback Machine - https://web.archive.org/web/20201209034148/https://github.com/volatiletech/sqlboiler/issues/873
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

Does sqlboiler support CASE statement? #873

Open
elfgoh opened this issue Dec 6, 2020 · 0 comments
Open

Does sqlboiler support CASE statement? #873

elfgoh opened this issue Dec 6, 2020 · 0 comments

Comments

@elfgoh
Copy link

@elfgoh elfgoh commented Dec 6, 2020

What version of SQLBoiler are you using (sqlboiler --version)?

3.4.0

What is your database and version (eg. Postgresql 10)

Postgresql 9.6

I have a use case where I need to use the CASE statement, similar to the snippet. Question: is this supported in sqlboiler using helper methods? If it isn't, do I need to use queries.Raw(), or is there a workaround using something like generated columns(not supported in 9.6) or triggers? Any advice will be greatly appreciated 🙇

SELECT 
	 CASE WHEN alphaValue IS NULL THEN 'False' ELSE 'True' END AS hasAlphaValue
FROM someTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.
X Tutup