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 RAISE statement #1766

Merged
merged 1 commit into from
Mar 18, 2025
Merged

Add support for RAISE statement #1766

merged 1 commit into from
Mar 18, 2025

Conversation

iffyio
Copy link
Contributor

@iffyio iffyio commented Mar 17, 2025

RAISE USING MESSAGE = 'error';

BigQuery

Snowflake

@iffyio iffyio requested a review from alamb March 17, 2025 07:25
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.

Looks good to me -- thanks @iffyio

#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
pub enum RaiseStatementValue {
/// `RAISE USING MESSAGE = 'error'`
UsingMessage(Expr),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can messages be arbitrary expressions (or must they always be strings?)

I think it is fine to use Expr here, I was just curious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah they can be arbitrary expressions, bigquery for example would accept this sql

begin
 select 1;
 exception when error then
   raise using message = 2+3;
 end;

@iffyio iffyio merged commit e3e8829 into apache:main Mar 18, 2025
9 checks passed
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