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

Expression based cursor #4

Merged
merged 5 commits into from
May 22, 2023
Merged

Expression based cursor #4

merged 5 commits into from
May 22, 2023

Conversation

richardrissanen
Copy link

@richardrissanen richardrissanen commented May 19, 2023

Found this solution via the repos issues here: duffelhq#173

# Here we build the rank_value for each returned row
schema, :rank_value ->
{:ok, %{rows: [[rank_value]]}} =
Repo.query("SELECT ts_rank($1, plainto_tsquery('simple', $2))", [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardrissanen does this execute a new query per row?

Copy link
Author

@richardrissanen richardrissanen May 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That example does but I am sticking with our function based solution. However, there is a select merge that is required with this solution.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardrissanen got it. I think given the fact that this is a PR against the existing repo, and seems others have used it w success, I'm much less worried about the change

@richardrissanen richardrissanen merged commit 1f69bc5 into main May 22, 2023
@richardrissanen richardrissanen deleted the expression-based-cursor branch May 22, 2023 16:26
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.

4 participants