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

Add support for PostgreSQL LISTEN/NOTIFY syntax #1485

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

wugeer
Copy link
Contributor

@wugeer wugeer commented Oct 27, 2024

This PR supports LISTEN/NOTIFY clause for postgres dialect,. For more information, please refer to:
https://www.postgresql.org/docs/current/sql-listen.html
https://www.postgresql.org/docs/current/sql-notify.html

It also introduces the following keywords:

  • LISTEN
  • NOTIFY

This resolves issue #1481

@wugeer wugeer changed the title Add support for PostgreSQL LISTEN/NOTIFY Add support for PostgreSQL LISTEN/NOTIFY syntax Oct 27, 2024
Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! cc @alamb

@wugeer wugeer force-pushed the feat_add_listen_notify_channel_for_pg branch from e71f9cf to e6c96b9 Compare October 30, 2024 06:04
@wugeer
Copy link
Contributor Author

wugeer commented Oct 30, 2024

Sorry, I mixed up the documentation links for listen and notify in the last commit. And currently, only PostgreSQL supports listen and notify syntax, so I've added a dialect check and moved the tests to sqlparser_postgres.rs. Could you please review it again? @iffyio

@wugeer wugeer requested a review from iffyio October 30, 2024 06:20
src/parser/mod.rs Outdated Show resolved Hide resolved
tests/sqlparser_postgres.rs Outdated Show resolved Hide resolved
@wugeer wugeer requested a review from iffyio October 31, 2024 13:43
Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

Thanks @wugeer just one comment around the naming otherwise I think this looks good!

src/dialect/mod.rs Outdated Show resolved Hide resolved
@wugeer wugeer requested a review from iffyio October 31, 2024 23:15
Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! cc @alamb

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @wugeer and @iffyio

src/dialect/postgresql.rs Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 1, 2024

Pull Request Test Coverage Report for Build 11685106929

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 68 of 78 (87.18%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 89.391%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/dialect/mod.rs 2 4 50.0%
src/dialect/postgresql.rs 2 4 50.0%
tests/sqlparser_common.rs 43 49 87.76%
Totals Coverage Status
Change from base Build 11651598157: -0.005%
Covered Lines: 30568
Relevant Lines: 34196

💛 - Coveralls

@wugeer wugeer force-pushed the feat_add_listen_notify_channel_for_pg branch 3 times, most recently from 6ff8f27 to b9cbd1a Compare November 5, 2024 13:24
@iffyio
Copy link
Contributor

iffyio commented Nov 6, 2024

Will look to merge this given we're pending only a ci run

@iffyio iffyio merged commit 05821cc into apache:main Nov 6, 2024
10 checks passed
@alamb
Copy link
Contributor

alamb commented Nov 6, 2024

Woohoo -- it is great to see you merging PRs @iffyio

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