Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Uppercasing reserved words #86HEADmaster | Erik Andersson | 2019-03-13 | 1 | -0/+8 |
| | |||||
* | Add Indent Level as an arg for format method of Sqlformatter #88 | Erik Andersson | 2019-03-13 | 1 | -2/+2 |
| | |||||
* | Merge pull request #79 from stof/patch-3origin/masterorigin/HEAD | Jeremy Dorn | 2015-08-30 | 1 | -1/+1 |
|\ | | | | | Switch Travis to the stable HHVM version | ||||
| * | Switch Travis to the stable HHVM version | Christophe Coevoet | 2015-05-20 | 1 | -1/+1 |
|/ | |||||
* | Add support for named parameters (e.g. ":name"), treats them the same as ↵ | Jeremy Dorn | 2015-03-30 | 1 | -3/+3 |
| | | | | variables (e.g. "@name"). Fixes #74 | ||||
* | Merge pull request #65 from glensc/cli-bin2 | Jeremy Dorn | 2014-07-28 | 1 | -4/+26 |
|\ | | | | | Add color detection to bin/sql-formatter | ||||
| * | update paths in non-cli help | Elan Ruusamäe | 2014-06-06 | 1 | -3/+4 |
| | | |||||
| * | autodetect colors | Elan Ruusamäe | 2014-06-06 | 1 | -1/+22 |
| | | | | | | | | | | so we can redirect output to file and it will not be colored while outputing to terminal it would be colored | ||||
* | | Merge pull request #66 from Nyholm/patch-1 | Jeremy Dorn | 2014-07-08 | 1 | -0/+2 |
|\ \ | |/ |/| | Added HHVM to travis.yml | ||||
| * | Added HHVM to travis.yml | Tobias Nyholm | 2014-07-08 | 1 | -0/+2 |
|/ | |||||
* | Merge pull request #46 from rajibahmed/master | Jeremy Dorn | 2014-06-05 | 2 | -1/+20 |
|\ | | | | | Add bin/sql-formatter console script | ||||
| * | Add codes to sql-script removing require_once. | Rajib Ahmed | 2013-06-27 | 1 | -1/+15 |
| | | |||||
| * | Add sql-formatter executable by reusing cli.php | Rajib Ahmed | 2013-06-27 | 2 | -1/+6 |
| | | | | | | | | | | | | Fixed bin dir issue Fixed path | ||||
* | | Add proper formatting for square bracket quoted strings (SQL Server style). | Jeremy | 2014-04-16 | 7 | -15/+34 |
| | | | | | | | | For #63 | ||||
* | | Merge pull request #63 from drakej/master | Jeremy Dorn | 2014-04-16 | 1 | -3/+3 |
|\ \ | | | | | | | Added EXEC as a reserved word, add square brackets as boundary characters. | ||||
| * | | Fixed formatting | Jonathan Drake | 2014-04-16 | 1 | -1/+1 |
| | | | |||||
| * | | Added brackets as token boundaries | Jonathan Drake | 2014-04-16 | 1 | -1/+1 |
| | | | |||||
| * | | Added EXEC as a reserved word | Jonathan Drake | 2014-04-16 | 1 | -2/+2 |
|/ / | |||||
* | | Merge pull request #61 from h4cc/patch-1 | Jeremy Dorn | 2014-03-15 | 1 | -0/+2 |
|\ \ | | | | | | | Added PHP 5.5 and 5.6 to travis. | ||||
| * | | Added PHP 5.5 and 5.6 to travis. | Julius Beckmann | 2014-03-15 | 1 | -0/+2 |
|/ / | |||||
* | | Merge pull request #58 from domnikl/master | Jeremy Dorn | 2014-01-22 | 2 | -1/+20 |
|\ \ | | | | | | | Prevent warnings in highlightToken with binary data | ||||
| * | | cleaner solution to highlight binary data | Dominik Liebler | 2014-01-22 | 2 | -1/+20 |
| | | | | | | | | | | | | and added new test highlightBinaryData to test for this case | ||||
| * | | Prevent warnings in highlightToken | Dominik Liebler | 2014-01-21 | 1 | -1/+1 |
|/ / | |||||
* | | Fix PHP notice for queries that start with a boundary character.v1.2.17 | Jeremy Dorn | 2014-01-12 | 1 | -2/+2 |
| | | | | | | | | This was caused by a missing isset check. Fixes #57 | ||||
* | | Fix formatting of negative numbers (fixes #49).v1.2.16 | Jeremy Dorn | 2013-11-27 | 7 | -17/+116 |
| | | | | | | | | Improve phpunit code coverage. | ||||
* | | Bump minor version number. | Jeremy Dorn | 2013-11-27 | 1 | -1/+1 |
| | | |||||
* | | Merge branch 'master' of https://github.com/augusteiner/sql-formatter into ↵ | Jeremy Dorn | 2013-11-27 | 1 | -5/+5 |
|\ \ | | | | | | | | | | | | | | | | | | | augusteiner-master Conflicts: lib/SqlFormatter.php | ||||
| * | | Corrected class name pass for closures. | José Augusto de Araújo Nascimento | 2013-11-26 | 1 | -6/+6 |
| | | | |||||
* | | | Optimized speed of initializing reserved words list. | Michal Brašna | 2013-11-26 | 1 | -15/+4 |
|/ / | |||||
* | | Increase PhpUnit code coverage. | Jeremy Dorn | 2013-09-18 | 8 | -237/+853 |
| | | | | | | | | | | | | Fix undefined variable $clause_limit notice. A couple PSR fixes. Bump version number. | ||||
* | | Update pull #52 - // Checks if we are out of the limit clause | Lairson Alencar | 2013-09-16 | 1 | -2/+2 |
| | | |||||
* | | Update pull #52 | Lairson Alencar | 2013-09-16 | 1 | -0/+5 |
| | | |||||
* | | #34 - Added formatting to SQL LIMIT | Lairson Alencar | 2013-09-16 | 1 | -5/+17 |
| | | | | | | | | The Formatting was added as suggested by leeoniya (issue #34). | ||||
* | | A few PSR code fixes. | Jeremy Dorn | 2013-09-02 | 1 | -5/+7 |
| | | |||||
* | | Add highlighting support for binary/hex numbers and user-defined variables. | Jeremy Dorn | 2013-09-02 | 4 | -20/+70 |
| | | | | | | | | | | | | Add ":" to the boundary list (fixes ":=" assignment operator). Standardize whitespace around "if" clauses in the php code. Now there is always a space after "if" and before "(". Fixes #50 | ||||
* | | Made compress remove extra whitespace from reserved words. Fixes #51 | Jeremy Dorn | 2013-09-02 | 1 | -1/+5 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ```sql LEFT OUTER JOIN ``` becomes ```sql LEFT OUTER JOIN ``` | ||||
* | | Bump version number | Jeremy Dorn | 2013-07-11 | 1 | -1/+1 |
| | | |||||
* | | Formatting and naming changes in order to merge @adityagoyal pull request. | Jeremy Dorn | 2013-07-11 | 2 | -240/+195 |
| | | |||||
* | | Merge branch 'master' of https://github.com/adityagoyal/sql-formatter into ↵ | Jeremy Dorn | 2013-07-10 | 2 | -14/+73 |
|\ \ | | | | | | | | | | adityagoyal-master | ||||
| * | | removeComments | adityagoyal | 2013-07-06 | 1 | -1/+1 |
| | | | |||||
| * | | Revert "test case" | adityagoyal | 2013-07-06 | 1 | -1/+1 |
| | | | | | | | | | | | | This reverts commit 3f39d54f21236e9afdf0e53f759c430d0fae9365. | ||||
| * | | test case | adityagoyal | 2013-07-06 | 1 | -1/+1 |
| | | | |||||
| * | | test case | adityagoyal | 2013-07-06 | 1 | -1/+1 |
| | | | |||||
| * | | removed remove_blank_line method as suggested and calling format method to ↵ | adityagoyal | 2013-07-06 | 1 | -11/+1 |
| | | | | | | | | | | | | | | | | | | | | | format after removing comments. removed remove_blank_line method as suggested and calling format method to format after removing comments. | ||||
| * | | highlight mysql functions. | adityagoyal | 2013-07-05 | 1 | -2/+71 |
| | | | | | | | | | | | | | | | Added methods to highlight mysql functions.Removed now() ,count from reserved keyword.They are a part of mysql functions. | ||||
* | | | Merge branch 'master' of https://github.com/adityagoyal/sql-formatter into ↵ | Jeremy Dorn | 2013-07-01 | 2 | -7/+26 |
|\ \ \ | |/ / | | / | |/ |/| | adityagoyal-master | ||||
| * | Added LEFT OUTER JOIN, RIGHT OUTER JOIN in newline reserved keys.Removed XOR. | adityagoyal | 2013-06-30 | 1 | -0/+5 |
| | | | | | | | | | | | | Added LEFT OUTER JOIN, RIGHT OUTER JOIN in newline reserved keys.Removed XOR. Added LEFT OUTER JOIN and RIGHT OUTER JOIN example for windows. | ||||
| * | removed XOR as it was there in reserved newline.Added LEFT OUTER JOIN and ↵ | adityagoyal | 2013-06-30 | 1 | -2/+2 |
| | | | | | | | | | | | | | | RIGHT OUTER JOIN in newline. removed XOR as it was there in reserved newline.Added LEFT OUTER JOIN and RIGHT OUTER JOIN in newline. | ||||
| * | removed extra parenthesis and indented code by replacing tab with spaces. | adityagoyal | 2013-06-30 | 1 | -16/+16 |
| | | | | | | | | | | removed extra parenthesis and indented code by replacing tab with spaces. | ||||
| * | added reserved keys for sql formatter | adityagoyal | 2013-06-30 | 1 | -6/+9 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added many reserved keywords of mysql. ( SQL_SMALL_RESULT , GEMINI,GEMINI_SPIN_RETRIES,MASTER_LOG_POS,MASTER_PASSWORD,MASTER_PORT,MASTER_USER,MATCH ,MAX_CONNECTIONS_PER_HOUR,MAX_QUERIES_PER_HOUR,MAX_ROWS,MAX_UPDATES_PER_HOUR,MAX_USER_C ONNECTIONS,RAID0,RAID_CHUNKS,RAID_CHUNKSIZE,RAID_TYPE, 'SQL_AUTO_IS_NULL', 'SQL_BIG_RESULT', 'SQL_BIG_SELECTS', 'SQL_BIG_TABLES', 'SQL_BUFFER_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_LOG_BIN', 'SQL_LOG_OFF', 'SQL_LOG_UPDATE', 'SQL_LOW_PRIORITY_UPDATES', 'SQL_MAX_JOIN_SIZE', 'SQL_QUOTE_SHOW_CREATE', 'SQL_SAFE_UPDATES', 'SQL_SELECT_LIMIT', 'SQL_SLAVE_SKIP_COUNTER', 'SQL_SMALL_RESULT', 'SQL_W STRIPED,true,'XOR') | ||||
| * | removed new line between queries | adityagoyal | 2013-06-29 | 1 | -1/+12 |
| | | | | | | | | | | Added a method remove_blank_lines(String) that checks for blank new line and removes it. | ||||
* | | Added missing mysql 'CHARACTER SET' keyword | Stéphane Klein | 2013-06-24 | 1 | -1/+1 |
|/ | |||||
* | Added new compress method. Fixes #41 | Jeremy Dorn | 2013-06-12 | 6 | -6/+459 |
| | | | | | Added test cases for CLI mode and compress method. Bumped patch version. | ||||
* | Changed license to MIT to simplify inclusion in other libraries.v1.2.9 | jdorn | 2013-04-26 | 3 | -3/+24 |
| | |||||
* | Improving block comment formatting. Fixes #37 | Jeremy Dorn | 2013-03-31 | 3 | -3/+5 |
| | |||||
* | Fixing bug with comment formatting. Fixes #36 | Jeremy Dorn | 2013-03-31 | 3 | -15/+21 |
| | |||||
* | Improved formatting of inline parentheses. Fixes #32 | Jeremy Dorn | 2013-03-20 | 5 | -366/+197 |
| | | | | | Added "IFNULL" as a reserved word. Changed "NOW" to "NOW()" in the reserved word list so it can be used within inline parentheses. | ||||
* | Changing example cli script to work with Unix pipes and command line arguments. | Jeremy Dorn | 2013-03-15 | 1 | -1/+14 |
| | |||||
* | Merge branch 'master' of https://github.com/jdorn/sql-formatter | Jeremy Dorn | 2013-03-14 | 5 | -123/+662 |
|\ | | | | | | | | | Conflicts: lib/SqlFormatter.php | ||||
| * | Splitting special reserved words into "top level reserved" and "newline ↵ | Jeremy Dorn | 2013-03-11 | 5 | -128/+667 |
| | | | | | | | | | | | | | | reserved". Now, JOIN keywords and logical operators (AND, OR, etc.) have a new line before them. Fixes #30 Also adding the composer.lock file to VSC. | ||||
* | | Adding support for CLI syntax highlighting. Fixes #33 | Jeremy Dorn | 2013-03-14 | 4 | -17/+95 |
|/ | |||||
* | Fixed formatting bug with multiple boundary characters (e.g. ">=", "<>", ↵ | Jeremy Dorn | 2013-03-07 | 6 | -24/+39 |
| | | | | | | etc.). Fixes #29 Improved code coverage in unit tests. Now everything is covered except the infinite loop catching code which I don't know how to test. | ||||
* | Fixing utf-8 encoding bug with PHP 5.3. Fixes #27 | Jeremy Dorn | 2013-03-07 | 3 | -5/+5 |
| | |||||
* | Adding PHPUnit as a dev dependency. | Jeremy Dorn | 2013-03-06 | 2 | -0/+5 |
| | |||||
* | replace 'static' keyword by 'self' to be compatible with php 5.2 | Franck Magnan | 2013-03-06 | 1 | -3/+3 |
| | |||||
* | fixed formatting | Franck Magnan | 2013-03-05 | 1 | -3/+3 |
| | |||||
* | remove option from output method and use attribute instead | Franck Magnan | 2013-03-05 | 1 | -12/+13 |
| | |||||
* | adding option to deactivate preformatted text | Franck Magnan | 2013-03-05 | 1 | -4/+23 |
| | |||||
* | Fixed bug when formatting "SELECT#comment" without a space before "#". | Jeremy Dorn | 2013-03-03 | 10 | -5937/+2039 |
| | | | | Added PHPUnit tests and .travis integration. | ||||
* | Fixing bug with parsing long strings. PCRE was seg faulting. Fixes #25 | Jeremy Dorn | 2013-02-21 | 1 | -1/+1 |
| | |||||
* | Using class constants for token types and token components now. | Jeremy Dorn | 2013-02-10 | 1 | -61/+78 |
| | | | | Resulted in a ~35% reduction in memory use and a slight decrease in performance. | ||||
* | Improving splitQuery method. Fixes #22 | Jeremy Dorn | 2013-02-10 | 3 | -18/+35 |
| | |||||
* | Making it easier to customize appearance. | Jeremy Dorn | 2013-01-17 | 2 | -4137/+4138 |
| | | | | | | Now, you can set whatever html attributes you want for each token type. Previously you could only set the value of the style attribute. You can also now set the html attributes for the containing pre tag. These changes make it easy to use classes instead of styles for example. | ||||
* | Fixed bug with unterminated strings. | Jeremy Dorn | 2013-01-08 | 1 | -27/+28 |
| | | | | | Changed behavior when a parse error is encountered. It use to throw an exception, but now it just returns the remaining string as a single token. Split highlighting logic for backtick quote and other quotes to make the code cleaner. | ||||
* | Fixed formatting bug when 2 special reserved words immediately followed each ↵ | Jeremy Dorn | 2012-12-29 | 4 | -7586/+1413 |
| | | | | | | | | other. Added set operators to special reserved list (UNION, UNION ALL, EXCEPT, and INTERSECT). Updated test sql list to reduce the number of similar queries and better reflect real world usecases. Improved output of the regression test to make debugging easier. | ||||
* | Removing "INSERT INTO" as a special reserved word. It looks better if ↵ | Jeremy Dorn | 2012-12-27 | 2 | -285/+197 |
| | | | | formatted as a regular reserved word. | ||||
* | Small bug fix and version bump. | Jeremy Dorn | 2012-12-27 | 1 | -2/+2 |
| | |||||
* | Fixing formatting bug when a special reserved word has multiple whitespace ↵ | Jeremy Dorn | 2012-12-27 | 1 | -3/+9 |
| | | | | characters in the middle (e.g. "Group By"). | ||||
* | Fixed a couple formatting bugs. Added a few more optimizations. | Jeremy Dorn | 2012-12-25 | 2 | -1450/+397 |
| | | | | | | | | | | | | Specifically: - Fixed double newlines that were appearing in some cases - Improved algorithm for inline parentheses. Now "decimal(7,2)" and "(table.column) will be inline - Fixed formatting bug with "ON UPDATE CURRENT_TIMESTAMP" - Fixed bug with numbers followed immediately by quotes (e.g. 1"test") - Reduced calls to highlightToken() - Used if blocks instead of switch statement when deciding how to highlight token - Used single quoted strings when possible to avoid parsing overhead | ||||
* | Fixed lots of formatting bugs and inconsistencies. Rewrote the format ↵ | Jeremy Dorn | 2012-12-24 | 2 | -7291/+4746 |
| | | | | method to better handle indentation. | ||||
* | Major refactoring of code to improve performance. Now using primarily ↵ | Jeremy Dorn | 2012-12-23 | 3 | -143/+12621 |
| | | | | | | | 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", ".", and "00") instead of a single number token. Added a simple regression testing script. | ||||
* | Cleaned up documentation, improved performance test script and sample queries. | Jeremy Dorn | 2012-12-23 | 4 | -94/+3711 |
| | |||||
* | Implemented caching during tokenization. Added a script for testing ↵v1.2.0 | Jeremy Dorn | 2012-12-22 | 4 | -8/+162 |
| | | | | performance. Bumped the dev version number. | ||||
* | Merge pull request #18 from stloyd/master | Jeremy Dorn | 2012-12-22 | 1 | -81/+99 |
|\ | | | | | Some code readability cleanup and additional micro-optimizations | ||||
| * | Some code readability cleanup and additional micro-optimizations | Joseph Bielawski | 2012-12-19 | 1 | -81/+99 |
|/ | |||||
* | Another optimization. Was performing an array merge for every format, ↵ | Jeremy Dorn | 2012-12-18 | 1 | -9/+14 |
| | | | | changed it to only do it once. | ||||
* | Merge pull request #16 from stloyd/patch-1 | Jeremy Dorn | 2012-12-18 | 1 | -16/+14 |
|\ | | | | | Update lib/SqlFormatter.php | ||||
| * | Update lib/SqlFormatter.php | Joseph Bielawski | 2012-12-18 | 1 | -16/+14 |
|/ | | | Introduce some micro-optimizations | ||||
* | Merge pull request #13 from stof/patch-2 | Jeremy Dorn | 2012-11-17 | 1 | -1/+1 |
|\ | | | | | | | Fixed the branch alias for master | ||||
| * | Fixed the branch alias for master | Christophe Coevoet | 2012-11-17 | 1 | -1/+1 |
|/ | |||||
* | Fixing several bugs. | Jeremy Dorn | 2012-11-12 | 1 | -2/+6 |
| | | | | | | An exception was being thrown when the last line of a query was a comment (without trailing \n). A PHP notice was being thrown when the last character in a query was a '('. A PHP notice was being thrown when the last part of a query was a '(' followed by a string or punctuation and missing the closing ')'. | ||||
* | Version bump.v1.1.0 | Jeremy Dorn | 2012-11-11 | 1 | -2/+3 |
| | |||||
* | Fixed bug that was marking "from" a reserved word in "select mytable.from" | Jeremy Dorn | 2012-11-02 | 1 | -16/+23 |
| | |||||
* | Adding more punctuation to the word boundary list. | Jeremy Dorn | 2012-10-31 | 1 | -1/+1 |
| | |||||
* | Fixing bug that was adding a space between a function name and the opening ↵ | Jeremy Dorn | 2012-10-31 | 1 | -4/+9 |
| | | | | | | parentheses. Now, it will only add a space if there was whitespace there originally. Adding "NOW" as a reserved word. | ||||
* | Small code style changes from pull request. | Jeremy Dorn | 2012-10-12 | 1 | -3/+2 |
| | |||||
* | UNIX mode restored (Fffuuuu). | Mathieu Chabanon | 2012-10-12 | 1 | -2/+8 |
| | |||||
* | Restructuring code to make it more maintainable.v1.0.1 | Jeremy Dorn | 2012-10-04 | 2 | -196/+324 |
| | | | | | Adding parameter to SqlFormatter::format() to disable syntax highlighting. Making the code compatible with PHP 5.2 by getting rid of an anonymous function. | ||||
* | Merge pull request #3 from stof/patch-1 | Jeremy Dorn | 2012-09-13 | 1 | -1/+1 |
|\ | | | | | Changed the composer autoloading to use the classmap | ||||
| * | Changed the composer autoloading to use the classmap | Christophe Coevoet | 2012-09-14 | 1 | -1/+1 |
|/ | | | | Using the ``files`` type is requiring the file on each request, even when it is not needed, instead of using the PHP autoloading. |