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

CREATE TABLE statements end up as one long line #40

Closed
carlbennettnz opened this issue Mar 14, 2018 · 1 comment
Closed

CREATE TABLE statements end up as one long line #40

carlbennettnz opened this issue Mar 14, 2018 · 1 comment

Comments

@carlbennettnz
Copy link

Given this input

CREATE TABLE items (
  a INT PRIMARY KEY,
  b TEXT
);

I'm getting this output

CREATE TABLE items (a INT PRIMARY KEY, b TEXT);
@nene
Copy link
Collaborator

nene commented Mar 14, 2018

This is currently by design. sql-formatter will break the parenthesized expression to multiple lines when it's long enough, for example try:

CREATE TABLE items (a INT PRIMARY KEY, b TEXT, c INT NOT NULL, d INT NOT NULL);

Currently though this max-length of parenthesized block is hard-coded to 50 characters. There's an issue #5 for making this configurable. Express your support there if you'd like to have such configurability.

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

No branches or pull requests

2 participants