summaryrefslogtreecommitdiff
path: root/sqlparse/engine
Commit message (Collapse)AuthorAgeFilesLines
* Index-based token_idx_prevSjoerd Job Postmus2016-06-121-2/+3
| | | | | Prevent some more calls to token_index in group_identifier_list. They are now all gone.
* Use specialized token_idx_next_by in group_aliased.Sjoerd Job Postmus2016-06-121-6/+4
| | | | | | | | | | 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.
* Re-use token index in group_identifier.Sjoerd Job Postmus2016-06-121-8/+13
|
* Replace _group_matching with an inward-out grouping algorithmSjoerd Job Postmus2016-06-121-8/+20
| | | | | | | | | | | 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-24/+14
| | | | | | 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.
* Call `Token`-methods index based.Sjoerd Job Postmus2016-06-121-24/+26
| | | | | | | | | | A lot of methods have token-to-idx magic due to `Token._find_matching` converting tokens to indexes. Unknowingly, this turns innocent looking algorithms into O(n^2) (or worse). This does not solve the problem, but makes it more clear by moving the call to `Token.token_index` obvious at the call-site, at the cost of repeating it over-and-over.
* CREATE TABLE should not be parsed as FunctionTenghuan2016-05-291-0/+9
|
* refactor group_commentsVictor Uriarte2016-05-111-15/+9
|
* separate identifier grouping into its componentsVictor Uriarte2016-05-101-77/+50
| | | | | leaving sql.Operations in for future PR small behavior changed for invalid identifier
* refactor identifier list and alias groupingVictor Uriarte2016-05-101-62/+26
|
* refactor _group_left_rightVictor Uriarte2016-05-101-64/+39
|
* group all the one-offsVictor Uriarte2016-05-101-31/+21
|
* Add group matching M_tokens and refactor group matchingVictor Uriarte2016-05-101-90/+22
| | | | remove slots in subclasses
* Introduce @recurse to refactor recursionVictor Uriarte2016-05-101-11/+7
|
* generalize group_tokens for more use casesVictor Uriarte2016-05-101-10/+4
|
* Improve identifier parsing when identifier is a literal combined with order ↵Andi Albrecht2016-04-061-0/+2
| | | | keyword (fixes #101).
* Fix #230 (function comparison grouping)saaj2016-04-051-1/+2
|
* Code cleanup.Andi Albrecht2016-04-031-24/+19
|
* fix issue #215Shen Longxing2015-12-181-2/+2
| | | Add splitlevel for while/end while
* Merge branch 'hotfix'.Andi Albrecht2015-12-081-3/+3
|\
| * Workaround to avoid IndexError when grouping identifiers.Andi Albrecht2015-12-081-3/+3
| |
* | Cleanup module code.Andi Albrecht2015-10-263-11/+13
|/
* Fix PendingDeprecationWarning on Python 3.5.Tim Graham2015-10-231-1/+1
| | | | | Avoid "PendingDeprecationWarning: generator 'group_identifier.<locals>._consume_cycle' raised StopIteration."
* Speed up token_index by providing a starting index.Ryan Wooden2015-10-211-8/+10
|
* Limit number of tokens checked in group_identifier.Ryan Wooden2015-10-211-2/+5
| | | | | This significantly improves performance when grouping a large list of IDs.
* Handle END IF correctly when splitting statements (fixes #194).Andi Albrecht2015-07-281-0/+3
|
* Don't treat DECLARE within BEGIN blocks as relevant to split level (fixes #193).Andi Albrecht2015-07-261-1/+1
|
* 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-4/+43
| | | | | - 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 _find_matching to a module-level functionDarik Gamble2015-03-041-11/+13
|
* Group adjacent names to allow aliasing without the AS keywordDarik Gamble2015-02-091-3/+4
|
* (postgresql) Add support for square bracket array indexing, by darikg.Andi Albrecht2015-02-081-1/+3
| | | | Pull request #170 with trivial conflicts resolved.
* Group comments to parent object (fixes #160).Andi Albrecht2015-01-171-1/+20
|
* Improve parsing of inline comments for identifiers (fixes #163).Andi Albrecht2015-01-161-0/+2
|
* Improve formatting of HAVING statements.Andi Albrecht2014-12-211-1/+1
|
* Better handling of floats in UPDATE statements (issue145).Andi Albrecht2014-11-301-1/+1
|
* Handle single quoted strings in comparisons correctly (fixes issue148).Andi Albrecht2014-10-291-1/+2
|
* Fix a regression introduced in 0.1.12.Andi Albrecht2014-10-081-1/+1
|
* Improve parsing of identifier lists containing placeholders.Andi Albrecht2014-03-181-1/+1
|
* Improve handling of NULL in aliased identifiers.Andi Albrecht2014-03-031-0/+3
|
* Fix parsing and formatting of statements containing EXCEPT keyword.Andi Albrecht2014-01-281-1/+1
|
* Improve parsing of string literals in columns.Andi Albrecht2014-01-101-0/+1
|
* Support for BEGIN/END blocks, add FOREACH keyword.Andi Albrecht2013-11-191-1/+13
|
* Improve grouping of expressions (targets #23).Andi Albrecht2013-10-241-1/+1
|
* Fix tagging of identifiers by not taking single quoted strings into account ↵Andi Albrecht2013-09-281-2/+1
| | | | (fixes #111).
* Parenthesis, Functions and Arithmetic Expressionsprudhvi2013-09-131-4/+9
| | | are valid types to group an identifier
* Allow NULL keyword in assignments (fixes #90).Andi Albrecht2013-04-201-1/+3
|
* Allow keywords in identifier lists (fixes #10).Andi Albrecht2013-04-061-0/+1
|
* Add order criterion to identifier in ORDER BY clause (fixes #89).Andi Albrecht2013-04-051-0/+15
|
* Add encoding parameter to top-level functions (fixes issue20).Andi Albrecht2013-04-041-2/+2
|