summaryrefslogtreecommitdiff
path: root/sqlparse/engine/grouping.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix typostypoVictor Uriarte2017-11-291-3/+3
|
* Fix handling of semicolon when grouping assignments (fixes #359).Andi Albrecht2017-09-241-1/+1
| | | | | | When grouping assignments that contain a semicolon itself, the engine was too greedy. Assignments with semicolon were introduced in 691c0400e5a7d8229b7dce09bf47176539add328.
* Re-order parsing so that comparisons are seens as identifiers (fixes #327).Andi Albrecht2017-04-181-2/+2
|
* Fix special case for #284 when statement starts with orphaned AS.Andi Albrecht2016-10-241-1/+1
|
* Handle operator grouping after identifying typecasts (fixes #297).Andi Albrecht2016-10-011-1/+1
|
* Correct license link (fixes #288).Andi Albrecht2016-09-141-1/+1
|
* Merge pull request #285 from vmuriart/unify_naming_schemaAndi Albrecht2016-08-241-5/+5
|\ | | | | Unify_naming_schema. Closes #283
| * Unify_naming_schema. Closes #283Victor Uriarte2016-08-221-5/+5
| |
* | Fix #284 as groupingVictor Uriarte2016-08-221-1/+1
|/
* Previous fix for period failed when another token (non-groupable) followed.Victor Uriarte2016-06-191-3/+8
|
* Revert behavior of dangling period(hanging schema qualifier)Victor Uriarte2016-06-181-2/+2
| | | | | | Related to #261. Reverting to previous behavior until a way to handle behavior/grouping of invalid sql is agreed upon.
* Misc. small code clean-up/commentsVictor Uriarte2016-06-181-3/+2
|
* Change group_matching back to idxVictor Uriarte2016-06-151-6/+16
|
* remove group left_rightVictor Uriarte2016-06-151-27/+0
|
* Change grouping from _left_right to _groupVictor Uriarte2016-06-151-18/+71
|
* remove extra recurse and rename varsVictor Uriarte2016-06-151-30/+43
| | | | | # Conflicts: # sqlparse/engine/grouping.py
* Refactor _group's prev token logicVictor Uriarte2016-06-151-13/+11
|
* Reduce calls by _group to get tk idxVictor Uriarte2016-06-151-4/+15
|
* Re-Write grouping functionsVictor Uriarte2016-06-151-29/+47
|
* Reorder grouping code and func call orderVictor Uriarte2016-06-151-67/+66
| | | | Remove repeated for-each/for grouping
* Make use of token_index more obviousVictor Uriarte2016-06-151-4/+6
|
* Normalize behavior between token_next and token_next_byVictor Uriarte2016-06-151-13/+12
| | | | both will now return the "next" token and not itself when passing own index
* Rename token_idx_ funcs to simply token_ funcsVictor Uriarte2016-06-151-50/+50
|
* Change token_ funcs to token_idx funcsVictor Uriarte2016-06-151-52/+59
|
* Change argument order to match order of all other functionsVictor Uriarte2016-06-141-1/+2
|
* Refactor _group_matchingVictor Uriarte2016-06-141-17/+13
|
* Apply alt style for grouping left/rightVictor Uriarte2016-06-141-7/+9
|
* Reapply fix for case within paranthesisVictor Uriarte2016-06-141-1/+3
|
* Merge remote-tracking branch 'core/long_live_indexes' into developVictor Uriarte2016-06-141-67/+69
|\
| * Use a specialized token_idx_next.Sjoerd Job Postmus2016-06-121-4/+4
| | | | | | | | Prevent calling token_index.
| * 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.
* | Refactor groupingVictor Uriarte2016-06-121-8/+11
| | | | | | | | Alternate form to transverse the tlists and clean up matching.
* | Add sql.Operation tokenlistVictor Uriarte2016-06-121-7/+7
| |
* | Fix grouping of `case` within parenthesis.Victor Uriarte2016-06-111-0/+2
| | | | | | | | Closes #164
* | clean up groupingVictor Uriarte2016-06-111-3/+4
| |
* | Refactor filter-stack to simplify logicVictor Uriarte2016-06-041-2/+3
| | | | | | | | | | | | if (self.stmtprocess or self.postprocess or self.split_statements or self._grouping): always evaluates to true after removing unused features
* | Add or Update copyright year to filesVictor Uriarte2016-06-041-0/+5
| |
* | Fix flake8 stylingVictor Uriarte2016-05-291-2/+3
| |
* | Fix unicode comparison warningVictor Uriarte2016-05-291-2/+2
|/
* 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
|