GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for AllTableColumns in PrimaryExpression by tomershay · Pull Request #2197 · JSQLParser/JSqlParser

Conversation

@tomershay

@tomershay tomershay commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

PostgreSQL supports expressions such as posts.* (all columns from the posts table) in many places, such as the GROUP BY clause.

For example, in this query:

select c.post_id, p.* from posts p inner join comments c on c.post_id = p.post_id group by p.post_id, c.post_id, p.*;

This PR adds support for AllTableColumns in PrimaryExpression.

I wasn't sure if PrimaryExpression is the best fit for this, so will be happy for suggestions on relocating it if there's a better expression group for it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@manticore-projects

manticore-projects commented Mar 21, 2025

Copy link
Copy Markdown
Contributor

@tomershay

Thank you for this contribution. My understanding is: A PrimaryExpression can be used anywhere and everywhere -- which is not the case for AllColumns or AllTableColumns and especially seems to depend on the RDBMS also. However, from a pragmatical view it comes close and indeed seem to make sense.

However, we segregate both Expression at other places already and I believe even have to use semantic lookaheads (which are expensive). So in my opinion, we either

a) keep segregating AllColumns or AllTableColumns wherever it is allowed (cleaner and faster) or
b) remove all those segregations in all productions and incorporate AllColumns or AllTableColumns into PrimaryExpression (slower, but more pragmatic)

What I will not want is a mix of both approaches because it can make the Grammar even harder to maintain in the future.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tomershay
Add support for AllTableColumns in primary expression
2e27ef1
@tomershay
tomershay force-pushed the tomer_shay_support_alltablecolumns_in_primary_expression branch from a0665a2 to 2e27ef1 Compare March 21, 2025 15:49
@tomershay

tomershay commented Mar 21, 2025

Copy link
Copy Markdown
Contributor Author

@manticore-projects, thanks, makes total sense.

remove all those segregations in all productions and incorporate AllColumns or AllTableColumns into PrimaryExpression (slower, but more pragmatic)

I went with the approach above, so I removed the segregation of AllColumns or AllTableColumns in other places, and added them just to PrimaryExpression.

Looking forward to hearing your thoughts.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects
manticore-projects merged commit 9fd3b9f into JSQLParser:master Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tomershay @manticore-projects
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.