sql-formatter icon indicating copy to clipboard operation
sql-formatter copied to clipboard

A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.

Results 13 sql-formatter issues
Sort by recently updated
recently updated
newest added

I have the following Column definition in my Symfony project ```php #[ORM\Entity] class Queue { [...] #[ORM\Column( insertable: false, updatable: false, columnDefinition: 'SERIAL', )] private ?int $autoIncrement = null; [...]...

bug

At the moment, even though valid, these kind of queries would crash doctrine-bundle + twig ```php $connection->executeQuery("SELECT {$connection->quote((new \Symfony\Component\Uid\Ulid())->toBinary())}"); ``` We are running all of these queries through this formatter,...

enhancement
help wanted

It should not start a new line before and after the "SET" like it does here: ![image](https://github.com/doctrine/sql-formatter/assets/467942/44b43e24-ad6b-4cbf-86f4-64d8193aa284) ![image](https://github.com/doctrine/sql-formatter/assets/467942/ae21528e-fa7c-4812-ba4f-6870bd14a5c3) Here's the raw query for the 2nd example: `ALTER TABLE o2_test ADD...

Fixed lots of issues with formatting non-trivial SQL queries. This is NOT backwards compatible, there are many breaking changes. This is more in line with what looks good to me...

enhancement

This adds a new optional third parameter to the `format` method, `$forceUppercase` which defaults to `false` to maintain backwards compatibility. When passed as `true`, all keywords will be uppercased. There...

Hi, it's often more readable when selected column aliases are aligned vertically. Instead of this: SELECT   foo as one   foofoo as two   foofoofoo as three we can have this: SELECT...

See https://github.com/jdorn/sql-formatter/issues/97 and https://github.com/jdorn/sql-formatter/issues/84

In this example, why doesn't `ct_tag_id` end up on a new row? Given ```lang=sql CREATE TABLE /*_*/change_tag (ct_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ct_rc_id INTEGER UNSIGNED DEFAULT NULL, ct_log_id...

Given this input (as output from Doctrine, with trailing ; and newlines added) ```lang=sql CREATE TABLE /*_*/actor (actor_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, actor_user INT UNSIGNED DEFAULT NULL, actor_name VARBINARY(255)...

See https://github.com/jdorn/sql-formatter/issues/68