Commit graph

  • 7ef9b85961 Merge pull request #79 from stof/patch-3 master Jeremy Dorn 2015-08-30 09:36:01 -07:00
  • 035b969820 Switch Travis to the stable HHVM version Christophe Coevoet 2015-05-20 12:35:01 +02:00
  • a6f868ec26 Initial commit of javascript port. javascript-port Jeremy 2015-05-11 22:28:23 -07:00
  • ffecdad6ca Add support for named parameters (e.g. ":name"), treats them the same as variables (e.g. "@name"). Fixes #74 Jeremy Dorn 2015-03-30 10:07:12 -07:00
  • ff0515fa8c Merge pull request #65 from glensc/cli-bin2 Jeremy Dorn 2014-07-28 06:45:38 -07:00
  • 017b6628e7 Merge pull request #66 from Nyholm/patch-1 Jeremy Dorn 2014-07-08 15:36:13 -07:00
  • 327c184c58 Added HHVM to travis.yml Tobias Nyholm 2014-07-08 18:13:33 +02:00
  • 2a30f6a8a6 update paths in non-cli help Elan Ruusamäe 2014-06-06 20:41:02 +03:00
  • 069e49d5da autodetect colors Elan Ruusamäe 2014-06-06 20:36:01 +03:00
  • ebeb18ffd9 Merge pull request #46 from rajibahmed/master Jeremy Dorn 2014-06-05 08:00:04 -07:00
  • ffd2441bc0 Add proper formatting for square bracket quoted strings (SQL Server style). Jeremy 2014-04-16 18:55:36 -07:00
  • 9fcbe73681 Merge pull request #63 from drakej/master Jeremy Dorn 2014-04-16 18:28:25 -07:00
  • f59daa21e2 Fixed formatting Jonathan Drake 2014-04-16 14:59:29 -07:00
  • 85bd9434a3 Added brackets as token boundaries Jonathan Drake 2014-04-16 13:29:15 -07:00
  • 08db51b6cd Added EXEC as a reserved word Jonathan Drake 2014-04-16 13:18:34 -07:00
  • 826d01c59b Merge pull request #61 from h4cc/patch-1 Jeremy Dorn 2014-03-15 07:22:01 -07:00
  • c52c2be471 Added PHP 5.5 and 5.6 to travis. Julius Beckmann 2014-03-15 12:44:06 +01:00
  • 38058f6fc4 Merge pull request #58 from domnikl/master Jeremy Dorn 2014-01-22 20:54:58 -08:00
  • dbeecfdfbb cleaner solution to highlight binary data Dominik Liebler 2014-01-22 10:44:21 +01:00
  • 5e3938b712 Prevent warnings in highlightToken Dominik Liebler 2014-01-21 12:28:01 +01:00
  • 64990d96e0 Fix PHP notice for queries that start with a boundary character. This was caused by a missing isset check. Fixes #57 v1.2.17 Jeremy Dorn 2014-01-12 08:20:24 -08:00
  • 8859d66473 Fix formatting of negative numbers (fixes #49). Improve phpunit code coverage. v1.2.16 Jeremy Dorn 2013-11-27 14:51:13 -08:00
  • 96effdcddc Bump minor version number. Jeremy Dorn 2013-11-27 08:04:33 -08:00
  • 235aae3fda Merge branch 'master' of https://github.com/augusteiner/sql-formatter into augusteiner-master Jeremy Dorn 2013-11-27 08:01:41 -08:00
  • d75c963095 Corrected class name pass for closures. José Augusto de Araújo Nascimento 2013-11-26 20:09:29 -03:00
  • 62b4cc0fa1 Optimized speed of initializing reserved words list. Michal Brašna 2013-11-26 12:44:02 +01:00
  • 51a660e97b Increase PhpUnit code coverage. Fix undefined variable $clause_limit notice. A couple PSR fixes. Bump version number. Jeremy Dorn 2013-09-18 07:43:47 -07:00
  • c3691fe2e2 Update pull #52 - // Checks if we are out of the limit clause Lairson Alencar 2013-09-16 13:22:51 -03:00
  • 504efb3558 Update pull #52 Lairson Alencar 2013-09-16 02:49:54 -03:00
  • 7f862d76ef #34 - Added formatting to SQL LIMIT Lairson Alencar 2013-09-16 01:17:32 -03:00
  • 7045fde316 A few PSR code fixes. Jeremy Dorn 2013-09-02 10:19:28 -07:00
  • f258a98eb4 Add highlighting support for binary/hex numbers and user-defined variables. 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 Jeremy Dorn 2013-09-02 10:12:06 -07:00
  • 0b30579a48 Made compress remove extra whitespace from reserved words. Fixes #51 Jeremy Dorn 2013-09-02 09:13:55 -07:00
  • bccca26bfe Bump version number Jeremy Dorn 2013-07-11 06:51:14 -07:00
  • e1aa999f64 Formatting and naming changes in order to merge @adityagoyal pull request. Jeremy Dorn 2013-07-11 06:48:17 -07:00
  • 7dc6794a53 Merge branch 'master' of https://github.com/adityagoyal/sql-formatter into adityagoyal-master Jeremy Dorn 2013-07-10 23:30:32 -07:00
  • f0bbbe1938 removeComments adityagoyal 2013-07-06 03:21:54 +05:30
  • 2b09b47a83 Revert "test case" adityagoyal 2013-07-06 02:54:04 +05:30
  • 3f39d54f21 test case adityagoyal 2013-07-06 02:26:29 +05:30
  • 1280763875 test case adityagoyal 2013-07-06 02:10:19 +05:30
  • b0e95c9fc8 removed remove_blank_line method as suggested and calling format method to format after removing comments. adityagoyal 2013-07-06 01:47:48 +05:30
  • ba8b1a3f8d highlight mysql functions. adityagoyal 2013-07-05 23:47:00 +05:30
  • a854653950 Merge branch 'master' of https://github.com/adityagoyal/sql-formatter into adityagoyal-master Jeremy Dorn 2013-07-01 07:27:06 -07:00
  • 38a4639611 Added LEFT OUTER JOIN, RIGHT OUTER JOIN in newline reserved keys.Removed XOR. adityagoyal 2013-06-30 15:10:52 +05:30
  • 6974c23faa removed XOR as it was there in reserved newline.Added LEFT OUTER JOIN and RIGHT OUTER JOIN in newline. adityagoyal 2013-06-30 14:56:53 +05:30
  • 33d79737c0 removed extra parenthesis and indented code by replacing tab with spaces. adityagoyal 2013-06-30 07:07:05 +05:30
  • fdaa5692ef added reserved keys for sql formatter adityagoyal 2013-06-30 00:42:13 +05:30
  • 7baacdd22d removed new line between queries adityagoyal 2013-06-29 12:21:35 +05:30
  • 00131d6553 Add codes to sql-script removing require_once. Rajib Ahmed 2013-06-27 16:23:41 +02:00
  • 6f9501ebd4 Add sql-formatter executable by reusing cli.php Rajib Ahmed 2013-06-27 11:35:26 +02:00
  • d7f10fbb2f Added missing mysql 'CHARACTER SET' keyword Stéphane Klein 2013-06-24 12:01:06 +02:00
  • 5de859a8ba Added documentation for compress method. Fixed bug with unreadable pre contents before prettyprint js loads. gh-pages Jeremy Dorn 2013-06-12 21:02:49 -07:00
  • 3c7983d6d6 Added new compress method. Fixes #41 Added test cases for CLI mode and compress method. Bumped patch version. Jeremy Dorn 2013-06-12 20:56:09 -07:00
  • bd1f09133f Changed license to MIT to simplify inclusion in other libraries. v1.2.9 jdorn 2013-04-26 11:42:52 -07:00
  • e38ea8a0cb Improving block comment formatting. Fixes #37 Jeremy Dorn 2013-03-31 15:29:24 -07:00
  • 4ca0c1b7e6 Fixing bug with comment formatting. Fixes #36 Jeremy Dorn 2013-03-31 15:21:10 -07:00
  • 665222b859 Initial commit of the Github Pages site. Jeremy Dorn 2013-03-23 19:21:10 -07:00
  • fa92df63b1 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 be used within inline parentheses. Jeremy Dorn 2013-03-20 21:18:34 -07:00
  • 46ec57eb77 Changing example cli script to work with Unix pipes and command line arguments. Jeremy Dorn 2013-03-15 13:25:42 -07:00
  • 248cceb90a Merge branch 'master' of https://github.com/jdorn/sql-formatter Jeremy Dorn 2013-03-14 22:47:35 -07:00
  • 4142e37805 Adding support for CLI syntax highlighting. Fixes #33 Jeremy Dorn 2013-03-14 22:40:54 -07:00
  • 999f8125a6 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 Also adding the composer.lock file to VSC. Jeremy Dorn 2013-03-11 11:41:07 -07:00
  • 2724ddb7fb 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 catching code which I don't know how to test. Jeremy Dorn 2013-03-07 18:26:59 -08:00
  • 17fdbb8bd3 Fixing utf-8 encoding bug with PHP 5.3. Fixes #27 Jeremy Dorn 2013-03-07 17:57:28 -08:00
  • d4c4db3598 Adding PHPUnit as a dev dependency. Jeremy Dorn 2013-03-06 13:30:30 -08:00
  • 1df1f5be6d replace 'static' keyword by 'self' to be compatible with php 5.2 Franck Magnan 2013-03-06 21:56:02 +01:00
  • d89d902381 fixed formatting Franck Magnan 2013-03-05 18:50:08 +01:00
  • 2bbd685687 remove option from output method and use attribute instead Franck Magnan 2013-03-05 18:43:46 +01:00
  • b27101b27e adding option to deactivate preformatted text Franck Magnan 2013-03-05 16:41:01 +01:00
  • 2efc4bb4f6 Fixed bug when formatting "SELECT#comment" without a space before "#". Added PHPUnit tests and .travis integration. Jeremy Dorn 2013-03-03 11:18:19 -08:00
  • 3d8a97325e Fixing bug with parsing long strings. PCRE was seg faulting. Fixes #25 Jeremy Dorn 2013-02-21 21:16:19 -08:00
  • 7a92826fe2 Using class constants for token types and token components now. Resulted in a ~35% reduction in memory use and a slight decrease in performance. Jeremy Dorn 2013-02-10 16:21:20 -08:00
  • d9a72005ce Improving splitQuery method. Fixes #22 Jeremy Dorn 2013-02-10 15:48:03 -08:00
  • da55bd7609 Making it easier to customize appearance. 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. Jeremy Dorn 2013-01-17 23:52:11 -08:00
  • a31cb6ffd6 Fixed bug with unterminated strings. 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. Jeremy Dorn 2013-01-08 09:30:08 -08:00
  • 7cc05be93f 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 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. Jeremy Dorn 2012-12-29 11:41:32 -08:00
  • 9aac5ea51a Removing "INSERT INTO" as a special reserved word. It looks better if formatted as a regular reserved word. Jeremy Dorn 2012-12-27 08:16:30 -08:00
  • cd9e399fed Small bug fix and version bump. Jeremy Dorn 2012-12-27 00:25:10 -08:00
  • 1f7d2b9b69 Fixing formatting bug when a special reserved word has multiple whitespace characters in the middle (e.g. "Group By"). Jeremy Dorn 2012-12-27 00:01:32 -08:00
  • bccfd5ad5c Fixed a couple formatting bugs. Added a few more optimizations. Specifically: Jeremy Dorn 2012-12-25 22:46:31 -08:00
  • 6b3516f87d Fixed lots of formatting bugs and inconsistencies. Rewrote the format method to better handle indentation. Jeremy Dorn 2012-12-24 16:51:26 -08:00
  • d0d9cea94c 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", ".", and "00") instead of a single number token. Added a simple regression testing script. Jeremy Dorn 2012-12-23 17:54:21 -08:00
  • 14d1b5449c Cleaned up documentation, improved performance test script and sample queries. Jeremy Dorn 2012-12-23 11:43:23 -08:00
  • c0ed5f1de6 First page commit Jeremy Dorn 2012-12-23 10:46:21 -08:00
  • aa86b3fed7 Implemented caching during tokenization. Added a script for testing performance. Bumped the dev version number. v1.2.0 Jeremy Dorn 2012-12-22 13:46:50 -08:00
  • 4dfcac8b42 Merge pull request #18 from stloyd/master Jeremy Dorn 2012-12-22 13:09:34 -08:00
  • 346cef24c1 Some code readability cleanup and additional micro-optimizations Joseph Bielawski 2012-12-19 10:51:04 +01:00
  • 15ab7a899e Another optimization. Was performing an array merge for every format, changed it to only do it once. Jeremy Dorn 2012-12-18 13:46:03 -08:00
  • 251b032a1a Merge pull request #16 from stloyd/patch-1 Jeremy Dorn 2012-12-18 13:38:33 -08:00
  • d543fe4624 Update lib/SqlFormatter.php Joseph Bielawski 2012-12-18 21:41:46 +01:00
  • 0461ab0ff1 Merge pull request #13 from stof/patch-2 Jeremy Dorn 2012-11-17 14:31:58 -08:00
  • b802a9f1ed Fixed the branch alias for master Christophe Coevoet 2012-11-17 11:23:50 +01:00
  • 8599a1ff7e Fixing several bugs. 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 ')'. Jeremy Dorn 2012-11-12 15:36:05 -08:00
  • e3083aafdf Version bump. v1.1.0 Jeremy Dorn 2012-11-11 11:10:49 -08:00
  • 2f482368c4 Fixed bug that was marking "from" a reserved word in "select mytable.from" Jeremy Dorn 2012-11-02 15:19:30 -07:00
  • afdd8dd767 Adding more punctuation to the word boundary list. Jeremy Dorn 2012-10-31 09:52:03 -07:00
  • 9bd0f82ef4 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. Jeremy Dorn 2012-10-31 09:40:15 -07:00
  • 832e96f476 Small code style changes from pull request. Jeremy Dorn 2012-10-12 12:45:09 -07:00
  • edfe2063dc UNIX mode restored (Fffuuuu). Mathieu Chabanon 2012-10-12 15:33:15 +02:00
  • f5759ef316 Restructuring code to make it more maintainable. Adding parameter to SqlFormatter::format() to disable syntax highlighting. Making the code compatible with PHP 5.2 by getting rid of an anonymous function. v1.0.1 Jeremy Dorn 2012-10-04 22:10:16 -07:00