MCPcopy
hub / github.com/andialbrecht/sqlparse / group_order

Function group_order

sqlparse/engine/grouping.py:408–416  ·  view source on GitHub ↗

Group together Identifier and Asc/Desc token

(tlist)

Source from the content-addressed store, hash-verified

406
407@recurse(sql.Identifier)
408def group_order(tlist):
409 """Group together Identifier and Asc/Desc token"""
410 tidx, token = tlist.token_next_by(t=T.Keyword.Order)
411 while token:
412 pidx, prev_ = tlist.token_prev(tidx)
413 if imt(prev_, i=sql.Identifier, t=T.Number):
414 tlist.group_tokens(sql.Identifier, pidx, tidx)
415 tidx = pidx
416 tidx, token = tlist.token_next_by(t=T.Keyword.Order, idx=tidx)
417
418
419@recurse()

Callers

nothing calls this directly

Calls 4

imtFunction · 0.90
token_next_byMethod · 0.80
token_prevMethod · 0.80
group_tokensMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…