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

feat: EXPOSED-560 Support DISTINCT ON from Postgres #2275

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

obabichevjb
Copy link
Collaborator

Description

Added support for DISTINCT ON clauses in the Query class, enabling retrieval of distinct rows based on specified columns for SQL SELECT statements.

Detailed description:

  • What: Introduced new methods withDistinctOn(Column<*>, vararg Column<*>) and withDistinctOn(Pair<Column<*>, SortOrder>, vararg Pair<Column<*>, SortOrder>) in the Query class to allow the use of DISTINCT ON clauses. These methods enable distinct rows selection based on the specified columns and optionally ordered by specified sort orders.
  • Why: We had several requests for that feature from GitHub and Slack
  • How: The changes were implemented by:
    • Adding two new methods to the Query class to set the distinctOn property.
    • Adjusting the prepareSQL method to include the DISTINCT ON clause when distinctOn is set.

Type of Change

  • New feature

Affected databases:

  • Postgres
  • H2

Related Issues

EXPOSED-560 Support DISTINCT ON from Postgres
#500

@obabichevjb obabichevjb force-pushed the obabichev/exposed-560-distinct-on branch from 6ed3b83 to 7a67160 Compare October 15, 2024 11:56
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.

2 participants