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

change sql formatter to sql-formatter #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tokubara
Copy link

@Tokubara Tokubara commented Mar 7, 2023

The default sql formatter sqlformat doesn't work. For example:

CREATE TABLE student (
sid INT PRIMARY KEY, name VARCHAR(16), login VARCHAR(32) UNIQUE, age SMALLINT, gpa FLOAT );

format this piece of sql with

sqlformat tmp.sql  --reindent --indent_width 4 --keywords upper --use_space_around_operators

gets:

CREATE TABLE student (sid INT PRIMARY KEY,
                                      name VARCHAR(16),
                                           login VARCHAR(32) UNIQUE,
                                                             age SMALLINT, gpa FLOAT);

Without any options, sqlformat tmp.sql just prints the input.

The comment in the first answer about sqlformat points out the same thing.

While sql-formatter works great without any options. So I change sqlformat support to sql-formatter.

@lassik
Copy link
Owner

lassik commented Mar 8, 2023

We should keep supporting sqlformat. But I agree it's confusing that it does not do anything without any options.

Please edit the PR so that it:

  • preserves sqlformat
  • adds sql-formatter
  • changes the default from sqlformat to sql-formatter

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