summaryrefslogtreecommitdiff
path: root/sqlparse/sql.py
Commit message (Collapse)AuthorAgeFilesLines
* Use specialized token_idx_next_by in group_aliased.Sjoerd Job Postmus2016-06-121-0/+20
| | | | | | | | | | The method group_aliased was making a lot of calls to token_index. By specializing token_next_by to token_idx_next_by, the calls to token_index became superfluous. Also use token_idx_next_by in group_identifier_list. It was making a lot of calls, which is now more than reduced in half.
* Replace _group_matching with an inward-out grouping algorithmSjoerd Job Postmus2016-06-121-4/+9
| | | | | | | | | | | All the matching between open/close was done all the time, first finding the matching closing token, and then grouping the tokens in between, and recurse over the newly created list. Instead, it is more efficient to look for the previous open-token on finding a closing-token, group these two together, and then continue on. squashed: Handle token indices in group_tokens_between and find_matching.
* Special-case group_tokens(..., tokens_between())Sjoerd Job Postmus2016-06-121-0/+23
| | | | | | When having been guaranteed that the tokens form a range, it is possible to get rid of a lot of calls to `Token.tokens.remove(...)` which are expensive.
* refactor sql.py functionsVictor Uriarte2016-05-111-82/+30
|
* refactor remove quotesVictor Uriarte2016-05-101-11/+3
|
* Add group matching M_tokens and refactor group matchingVictor Uriarte2016-05-101-19/+15
| | | | remove slots in subclasses
* generalize group_tokens for more use casesVictor Uriarte2016-05-101-9/+25
|
* adding powerful _token_matching and imt helperVictor Uriarte2016-05-101-6/+30
|
* update sqlVictor Uriarte2016-05-101-8/+8
|
* Code cleanup.Andi Albrecht2016-04-031-2/+4
|
* Ensure get_type() works for queries that use WITH.Andrew Tipton2016-03-021-0/+12
|
* Fix version check when casting TokenList to string (fixes #212).Andi Albrecht2015-12-081-1/+1
|
* Remove sql.Token.to_unicode.Andi Albrecht2015-10-261-8/+0
|
* Cleanup module code.Andi Albrecht2015-10-261-8/+9
|
* Use compat module for single Python 2/3 code base.Andi Albrecht2015-10-261-11/+12
| | | | This change includes minor fixes and code cleanup too.
* Speed up token_index by providing a starting index.Ryan Wooden2015-10-211-1/+9
|
* Limit number of tokens checked in group_identifier.Ryan Wooden2015-10-211-2/+2
| | | | | This significantly improves performance when grouping a large list of IDs.
* Ignore comments at beginning of statement when calling Statement.get_type ↵Andi Albrecht2015-07-261-2/+10
| | | | (fixes #186).
* Improve detection of aliased identifiers (fixes #185).Andi Albrecht2015-04-191-1/+2
|
* Group square-brackets into identifiersDarik Gamble2015-03-041-4/+5
| | | | Indentifier.get_array_indices() looks for square brackets, and yields lists of bracket grouped tokens as array indices
* Parse square brackets as a group just like parensDarik Gamble2015-03-041-0/+9
| | | | | - add class sql.SquareBrackets - replace group_parenthesis() with more generic group_brackets(), which groups square and round brackets, so each can contain groups of the other
* Move get_parent_name() from Identifer to TokenList (so Function can use it)Darik Gamble2015-02-091-21/+11
|
* get_name() uses _get_first_name()Darik Gamble2015-02-091-0/+4
|
* get_alias() uses _get_first_name(), and searches in reverse for "column ↵Darik Gamble2015-02-091-13/+9
| | | | expression alias"
* TokenList convenience method _get_first_nameDarik Gamble2015-02-091-0/+18
|
* (postgresql) Add support for square bracket array indexing, by darikg.Andi Albrecht2015-02-081-0/+7
| | | | Pull request #170 with trivial conflicts resolved.
* Improve parsing of inline comments for identifiers (fixes #163).Andi Albrecht2015-01-161-0/+3
|
* Fix Function.get_parameters() returning empty list for SQL functions that ↵spigwitmer2014-02-051-3/+3
| | | | have a single nested function as a param
* Fix Function.get_parameters() with 1 literal as its parameterspigwitmer2014-02-041-0/+2
|
* Support for BEGIN/END blocks, add FOREACH keyword.Andi Albrecht2013-11-191-0/+6
|
* Improve grouping of expressions (targets #23).Andi Albrecht2013-10-241-0/+8
|
* Add skip_ws flag to Token.insert_after (fixes #108).Andi Albrecht2013-08-301-2/+2
|
* Fixed Function.get_parameters (issue93).wayne.wuw2013-05-091-0/+2
|
* Add order criterion to identifier in ORDER BY clause (fixes #89).Andi Albrecht2013-04-051-0/+7
|
* Add minimal changes to support Python 2.4.Andi Albrecht2013-02-281-1/+4
| | | | | Fair warning: Support for Python 2.4 may be dropped at any time. But as long as the changes are that minimal and have no significant side-effects we can keep up the compatibility.
* Helper function to return a token at a specific offset.Andi Albrecht2013-01-271-0/+9
|
* Doc updates.Andi Albrecht2013-01-011-1/+2
|
* Python 3 is now fully supported without any patches.Andi Albrecht2012-12-311-4/+22
| | | | | | | | | This change makes the extras/py3k stuff obsolete and installing for Python 3 is as easy as "python3 setup.py install". setup.py uses distribute's use_2to3 flag to automatically run 2to3 when Python 3 is used. \o/ Happy New Year, everyone!
* Remove superfluous cleanup conditions.Andi Albrecht2012-11-121-4/+1
|
* Improve handling of quoted indentifiers (fixes issue78).Andi Albrecht2012-11-031-6/+19
|
* Encode value when reprinting the object.Andi Albrecht2012-08-121-1/+1
|
* Merge branch 'master' into antiormJesús Leganés Combarro "Piranna"2012-05-191-1/+8
| | | | | Conflicts: sqlparse/filters.py
* Removed debug codeJesús Leganés Combarro2012-05-161-1/+0
|
* Some little optimizationsJesús Leganés Combarro "Piranna"2012-04-281-27/+28
|
* various optimizations in sql.pyquest2012-04-221-8/+19
|
* TokenLists.value is equal to their unicode() representation (fixes #30).Andi Albrecht2012-04-191-1/+1
|
* Pretty format comments in identifier lists (fixes issue59).Andi Albrecht2012-04-191-0/+8
|
* Changed get_case() to use a mode stateful variableJesús Leganés Combarro "Piranna"2012-02-031-15/+25
|
* Changed get_identifiers() to be a generatorJesús Leganés Combarro "Piranna"2012-02-031-3/+4
|
* Removed useless default return None (they are by default in Python)Jesús Leganés Combarro "Piranna"2012-02-031-9/+12
|