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

where Exists (select) #204

Open
3 tasks done
talpa opened this issue Mar 6, 2020 · 3 comments · May be fixed by #412
Open
3 tasks done

where Exists (select) #204

talpa opened this issue Mar 6, 2020 · 3 comments · May be fixed by #412
Assignees

Comments

@talpa
Copy link

talpa commented Mar 6, 2020

add please function exists

Dialect

  • postgres
  • mysql
  • sqlite3

Additional context
Add any other context or screenshots about the feature request here.

@torwald-sergesson
Copy link

"exists" function can be workarounded as:

goqu.L("EXISTS ?", subquery)

@torwald-sergesson
Copy link

I've tried to implement it using goqu.Func("EXISTS", subquery). But it fails on SQLite because of redundant parenthesis.
Such SQL:

SELECT EXISTS((SELECT `id` FROM `admins` WHERE (`id` > 20)));

is not valid for SQLite, although works for MySQL.

Yakov-Varnaev added a commit to Yakov-Varnaev/goqu that referenced this issue Mar 23, 2024
* add exists expression

* add select_dataset methods

* exists works for non prepared queries

* exists works for non prepared queries

* fixed test with prepared statement

* more expression examples

* expression examples fix
@Yakov-Varnaev Yakov-Varnaev linked a pull request Mar 23, 2024 that will close this issue
3 tasks
@Yakov-Varnaev
Copy link

I've tried to solve this in the PR above. Looking forward for your feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants