Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/doctrine/sql-formatter

A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.
https://github.com/doctrine/sql-formatter

removed extra parenthesis and indented code by replacing tab with spaces.

removed extra parenthesis and indented code by replacing tab with
spaces.

33d79737c077ba9d5606bcfa398e8926dc56f1cf authored over 11 years ago by adityagoyal <[email protected]>
added reserved keys for sql formatter

added many reserved keywords of mysql. (

SQL_SMALL_RESULT ,

GEMINI,GEMINI_SPIN_RETRIES,MASTER_...

fdaa5692efd1049d244d0c0aba403978ab02d428 authored over 11 years ago by adityagoyal <[email protected]>
removed new line between queries

Added a method remove_blank_lines(String) that checks for blank new line
and removes it.

7baacdd22d5bad19851cd3a8a76c5c545e20efb4 authored over 11 years ago by adityagoyal <[email protected]>
Add codes to sql-script removing require_once.

00131d65535a923d24fa32cba72df82ad9f9cfa4 authored over 11 years ago by Rajib Ahmed <[email protected]>
Add sql-formatter executable by reusing cli.php

Fixed bin dir issue

Fixed path

6f9501ebd4ac78eb1ff631931302891625afca32 authored over 11 years ago by Rajib Ahmed <[email protected]>
Added missing mysql 'CHARACTER SET' keyword

d7f10fbb2f871155cdd91b077acebb378e10a95c authored over 11 years ago by Stéphane Klein <[email protected]>
Added new compress method. Fixes #41

Added test cases for CLI mode and compress method.
Bumped patch version.

3c7983d6d638233ea8e0e7705a3a8f3e4921ca75 authored over 11 years ago by Jeremy Dorn <[email protected]>
Changed license to MIT to simplify inclusion in other libraries.

bd1f09133f6dbbe0713856910e58ea9480c2be58 authored over 11 years ago by jdorn <[email protected]>
Improving block comment formatting. Fixes #37

e38ea8a0cbd943ac78014d07f42441cd51d537db authored over 11 years ago by Jeremy Dorn <[email protected]>
Fixing bug with comment formatting. Fixes #36

4ca0c1b7e6501ec3404c07675372cf6076d8628b authored over 11 years ago by Jeremy Dorn <[email protected]>
Improved formatting of inline parentheses. Fixes #32

Added "IFNULL" as a reserved word.
Changed "NOW" to "NOW()" in the reserved word list so it can b...

fa92df63b164d001a37db5bf1460ef8ce3271a11 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Changing example cli script to work with Unix pipes and command line arguments.

46ec57eb77c2aaf6e685ecb9864ac01a5878cc77 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Merge branch 'master' of https://github.com/jdorn/sql-formatter

Conflicts:
lib/SqlFormatter.php

248cceb90a7b0e6551155c28e018495052403a25 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Adding support for CLI syntax highlighting. Fixes #33

4142e37805f1042096231e3471171cadec48e2ca authored almost 12 years ago by Jeremy Dorn <[email protected]>
Splitting special reserved words into "top level reserved" and "newline reserved".

Now, JOIN keywords and logical operators (AND, OR, etc.) have a new line before them. Fixes #30
A...

999f8125a66f44da7ee53db64e7aee3be8fa91ec authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixed formatting bug with multiple boundary characters (e.g. ">=", "<>", etc.). Fixes #29

Improved code coverage in unit tests. Now everything is covered except the infinite loop catchin...

2724ddb7fb79851a557d868a688fc269960bff87 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixing utf-8 encoding bug with PHP 5.3. Fixes #27

17fdbb8bd358d226dc1a9691c2245f041d72e3d3 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Adding PHPUnit as a dev dependency.

d4c4db359863c8f597805076531df627f78f97a8 authored almost 12 years ago by Jeremy Dorn <[email protected]>
replace 'static' keyword by 'self' to be compatible with php 5.2

1df1f5be6d465fcc8b412c1cc30c100decf9d3f2 authored almost 12 years ago by Franck Magnan <[email protected]>
fixed formatting

d89d902381230843629b0fb562e1929a67bafbc0 authored almost 12 years ago by Franck Magnan <[email protected]>
remove option from output method and use attribute instead

2bbd685687f72cd5ffc1b9f0b7c19b28f6dc694c authored almost 12 years ago by Franck Magnan <[email protected]>
adding option to deactivate preformatted text

b27101b27e1f5434fd985d38a5ade8cbc06cffbc authored almost 12 years ago by Franck Magnan <[email protected]>
Fixed bug when formatting "SELECT#comment" without a space before "#".

Added PHPUnit tests and .travis integration.

2efc4bb4f6f154d67125d313b1412926fe9d70ee authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixing bug with parsing long strings. PCRE was seg faulting. Fixes #25

3d8a97325e5894c72dd5c4d4f83dd3722d414d99 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Using class constants for token types and token components now.

Resulted in a ~35% reduction in memory use and a slight decrease in performance.

7a92826fe2734518e9cd6ebcf1ba052e58351c34 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Improving splitQuery method. Fixes #22

d9a72005ce780b73f4839a2d4931d12236bcca11 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Making it easier to customize appearance.

Now, you can set whatever html attributes you want for each token type. Previously you could onl...

da55bd76098f872b44343ba456db868cbcac8776 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixed bug with unterminated strings.

Changed behavior when a parse error is encountered. It use to throw an exception, but now it jus...

a31cb6ffd64a8f7efa8e92f46b99fe9f990f9299 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixed formatting bug when 2 special reserved words immediately followed each other.

Added set operators to special reserved list (UNION, UNION ALL, EXCEPT, and INTERSECT).
Updated t...

7cc05be93fc352be9c551bf5a45c7b930f5d9e2a authored almost 12 years ago by Jeremy Dorn <[email protected]>
Removing "INSERT INTO" as a special reserved word. It looks better if formatted as a regular reserved word.

9aac5ea51a1c13af3e67a7d7ba7e528f94c52485 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Small bug fix and version bump.

cd9e399fed1487656415f7c193d581f9dac86182 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixing formatting bug when a special reserved word has multiple whitespace characters in the middle (e.g. "Group By").

1f7d2b9b694f7999c0f60f1fbdeede9a7419e693 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixed a couple formatting bugs. Added a few more optimizations.

Specifically:

- Fixed double newlines that were appearing in some cases
- Improved algorithm for...

bccfd5ad5c490bb5ff3c8930015f352188b193f6 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Fixed lots of formatting bugs and inconsistencies. Rewrote the format method to better handle indentation.

6b3516f87d6636dcc3f847887eec82e852943247 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Major refactoring of code to improve performance. Now using primarily regular expressions instead of loops. 2x performance increase.

Found and fixed a minor bug in the process. "1.00" was being counted as 3 separate tokens ("1", "...

d0d9cea94cd6bdcdc3e164924e0d39e9192fe2bf authored almost 12 years ago by Jeremy Dorn <[email protected]>
Cleaned up documentation, improved performance test script and sample queries.

14d1b5449c635a4fae3cbabec9843a8d5a30a417 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Implemented caching during tokenization. Added a script for testing performance. Bumped the dev version number.

aa86b3fed70ea32f2e966342678dc7e02bb763d8 authored almost 12 years ago by Jeremy Dorn <[email protected]>
Merge pull request #18 from stloyd/master

Some code readability cleanup and additional micro-optimizations

4dfcac8b42a8094dd96fbcec61cd31f0cd031350 authored about 12 years ago by Jeremy Dorn <[email protected]>
Some code readability cleanup and additional micro-optimizations

346cef24c1e9c3daded6cb4c1ba3e314934ee750 authored about 12 years ago by Joseph Bielawski <[email protected]>
Another optimization. Was performing an array merge for every format, changed it to only do it once.

15ab7a899e33f42682f74804d340a6995711a0d4 authored about 12 years ago by Jeremy Dorn <jeremy@jeremy.(none)>
Merge pull request #16 from stloyd/patch-1

Update lib/SqlFormatter.php

251b032a1ae858063c4859430bee11b106bdd134 authored about 12 years ago by Jeremy Dorn <[email protected]>
Update lib/SqlFormatter.php

Introduce some micro-optimizations

d543fe462445d5c44b58f1e11a5e9ef698936d8e authored about 12 years ago by Joseph Bielawski <[email protected]>
Merge pull request #13 from stof/patch-2

Fixed the branch alias for master

0461ab0ff16e096b8c51f085349f38ed5f2ea241 authored about 12 years ago by Jeremy Dorn <[email protected]>
Fixed the branch alias for master

b802a9f1ed7cb9a2abdfb19bf37f771ccdcfd920 authored about 12 years ago by Christophe Coevoet <[email protected]>
Fixing several bugs.

An exception was being thrown when the last line of a query was a comment (without trailing \n).
...

8599a1ff7e35ee072959688baef1c7613839ed7c authored about 12 years ago by Jeremy Dorn <[email protected]>
Version bump.

e3083aafdf447af4abb47342158f6778e03c6d4b authored about 12 years ago by Jeremy Dorn <[email protected]>
Fixed bug that was marking "from" a reserved word in "select mytable.from"

2f482368c4e135779e3b294a925bb9e95777c614 authored about 12 years ago by Jeremy Dorn <jeremy@jeremy.(none)>
Adding more punctuation to the word boundary list.

afdd8dd767758bba4facc058a24bc43adc73056a authored about 12 years ago by Jeremy Dorn <jeremy@jeremy.(none)>
Fixing bug that was adding a space between a function name and the opening parentheses. Now, it will only add a space if there was whitespace there originally.

Adding "NOW" as a reserved word.

9bd0f82ef45cc54d80e423a65f1c5e837aa11ab0 authored about 12 years ago by Jeremy Dorn <jeremy@jeremy.(none)>
Small code style changes from pull request.

832e96f476327077343d4a7b5509f749334063ef authored about 12 years ago by Jeremy Dorn <jeremy@jeremy.(none)>
UNIX mode restored (Fffuuuu).

edfe2063dc730d1a81167583abcce1e104273885 authored about 12 years ago by Mathieu Chabanon <[email protected]>
Restructuring code to make it more maintainable.

Adding parameter to SqlFormatter::format() to disable syntax highlighting.
Making the code compat...

f5759ef3169fb4ef5a2bb206f3bdb8e1026546a7 authored about 12 years ago by Jeremy Dorn <[email protected]>
Merge pull request #3 from stof/patch-1

Changed the composer autoloading to use the classmap

fbb175cb6709d584e7e6c61aeee2b929c32d9a1a authored over 12 years ago by Jeremy Dorn <[email protected]>
Changed the composer autoloading to use the classmap

Using the ``files`` type is requiring the file on each request,
even when it is not needed, ins...

15b02bf20c0bc710c6425a5ac5c7c5c45379263b authored over 12 years ago by Christophe Coevoet <[email protected]>
Merge pull request #2 from dlsniper/improvements

Formatted source code according to PSR-1 and PSR-2. Added composer support

bd72a03db327dcbc16fb54907c247b98d012ccc8 authored over 12 years ago by Jeremy Dorn <[email protected]>
Formatted source code according to PSR-1 and PSR-2. Added composer support

997cc0e0dde3efa8e588eed419385ad8bd3b0556 authored over 12 years ago by Florin Patan <[email protected]>
Merge branch 'master' of https://github.com/jdorn/sql-formatter

94c7e4e67a5fcc989deb42e958114d829073f17b authored over 12 years ago by Jeremy Dorn <[email protected]>
Adding new removeComments method and using it before splitting queries.

Improved examples page.

1fc60240c8b31a1c8c35a82ff9d29017ac3579f1 authored over 12 years ago by Jeremy Dorn <[email protected]>
If a reserved word is found, it now returns it in the original case instead

of all uppercase.

94a3bfa3570f352bb9fe47831e54e8cb91064559 authored over 12 years ago by Jeremy Dorn <[email protected]>
Fixed bugs with splitQuery. Updated README and examples.

Fixed undefined variable error with highlight method.

638725ce8ebcfe244c31f24a7c1a40b609eb8ff3 authored over 12 years ago by Jeremy Dorn <[email protected]>
Adding a splitQuery method that splits a query string with multiple sql statements separated by ';'.

b763e808e64ffc830ace9b8b8e6f218062ff9254 authored over 12 years ago by Jeremy Dorn <[email protected]>
Adding "HAVING" to the special reserved word list.

5c31c9f4a79d21f8b32baa41783efcd434b4fafb authored over 12 years ago by Jeremy Dorn <[email protected]>
Added new method 'highlight' that only does syntax highlighting and

preserves original whitespace.

a90c9d4a49ac2d58d9737aecfeb117c2091abfe0 authored over 12 years ago by Jeremy Dorn <[email protected]>
Fixing include path in examples. Added example with comments.

4c6d7f11e8766ba49abf27afbcc0793df50ca7db authored over 12 years ago by jdorn <[email protected]>
Added in support for comments (--, #, and /*...*/ all supported)

cd5e0db57afe55d4ed02235cdb6d9ef48fb84021 authored over 12 years ago by jdorn <[email protected]>
Added example output screenshot. Created examples directory.

0ced5f358bc49de724cce2b0ab06a89369ed5c1e authored over 12 years ago by Jeremy Dorn <[email protected]>
Fixed indentation for subselects.

Fixed typo in error styling.
Added example for unmatched parentheses.

1109ff5bb76077a74cedc4860e2013c5a19a73f4 authored over 12 years ago by Jeremy Dorn <[email protected]>
Added more example SQL statements.

Moved all syntax highlighting styles to static properties that can be overwritten.
Simplified and...

c7da9c76b31480bfb0a448b6bd02ff7e8e3581a8 authored over 12 years ago by Jeremy Dorn <[email protected]>
Fixed bug where a reserved word at the end of the sql string would not be counted as a reserved word.

56729758424921143e38131f3b3c49682f438342 authored over 12 years ago by Jeremy Dorn <[email protected]>
Added htmlentities before outputting tokens to protect against html injection.

Moved whitespace and quote list to static variables.
Now, multiple whitespace characters in a row...

8767a4637c1423a86d2954764fa81da2c64eb242 authored over 12 years ago by Jeremy Dorn <[email protected]>
Added dot ('.') to the list of boundary characters so `Table`.`Column` formats correctly.

30d8efbfa4a98d8f7da6cc038cd7026a842c288d authored over 12 years ago by jdorn <[email protected]>
Fixed formatting bug when a special reserved word appears on a new line.

88bace86f94db54774e17eddb85e6831392870fd authored over 12 years ago by Jeremy Dorn <[email protected]>
initial commit of files

db7998963e87dd3212acef04fee0aa34dab2c9e2 authored over 12 years ago by Jeremy Dorn <[email protected]>
initial commit

b676c13ae9bb3eef5620cde54556a96fe61bfbf5 authored over 12 years ago by jdorn <[email protected]>