Skip to content

Feature: add the if macro.#796

Merged
tobymao merged 2 commits intomainfrom
toby/if_macro
May 1, 2023
Merged

Feature: add the if macro.#796
tobymao merged 2 commits intomainfrom
toby/if_macro

Conversation

@tobymao
Copy link
Contributor

@tobymao tobymao commented May 1, 2023

No description provided.

@tobymao tobymao requested review from crericha and treysp May 1, 2023 23:25
Copy link
Contributor

@crericha crericha May 1, 2023

Choose a reason for hiding this comment

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

Is this example still okay if we had:

"""select @if('a' = 'b', c), @if('a' = 'b', foo), d"""

which would be

select ,, d

Copy link
Contributor

@crericha crericha May 1, 2023

Choose a reason for hiding this comment

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

sqlglot seems okay with it. Interesting feature that will be good for the docs.

Cleaner than having to put the commas in the if macro.

@tobymao tobymao enabled auto-merge (squash) May 1, 2023 23:39
@tobymao tobymao merged commit ccd1cc6 into main May 1, 2023
@tobymao tobymao deleted the toby/if_macro branch May 1, 2023 23:45
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