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

Incorrectly formats variable assignation #502

Closed
federico-hero opened this issue Oct 17, 2023 · 2 comments · Fixed by #509
Closed

Incorrectly formats variable assignation #502

federico-hero opened this issue Oct 17, 2023 · 2 comments · Fixed by #509
Labels
bug Something isn't working

Comments

@federico-hero
Copy link

federico-hero commented Oct 17, 2023

Describe the bug

Incorrectly formats variable assignation operator := as : =.

To Reproduce

Run this correct SQL through sqlfmt:

select partman.create_parent( 'public.deliveries_finished', 'created_at', 'native', 'daily', p_premake := 20) ;

Expected behavior

select
    partman.create_parent(
        'public.deliveries_finished', 'created_at', 'native', 'daily', p_premake := 20
    )
;

Actual behavior

Notice the separation between the colon and the equal sign:

select
    partman.create_parent(
        'public.deliveries_finished', 'created_at', 'native', 'daily', p_premake: = 20
    )
;

Additional context

sqlfmt, version 0.20.0

This makes the SQL to fail.

@tconbeer
Copy link
Owner

Thanks for the report. Is this MySQL?

@tconbeer tconbeer added the bug Something isn't working label Oct 17, 2023
@federico-hero
Copy link
Author

This is Postgres (PL/pgSQL).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants