How to use the sqlparse.utils.imt function in sqlparse

To help you get started, we’ve selected a few sqlparse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andialbrecht / sqlparse / sqlparse / sql.py View on Github external
def matcher(tk):
            return not ((skip_ws and tk.is_whitespace)
                        or (skip_cm and imt(tk, t=T.Comment, i=Comment)))
        return self._token_matching(matcher, idx, reverse=_reverse)
github mtxr / SublimeText-SQLTools / SQLToolsAPI / lib / sqlparse / engine / grouping.py View on Github external
            lambda tk: imt(tk, t=T.Comment) or tk.is_whitespace(), idx=tidx)
        if end is not None:
github andialbrecht / sqlparse / sqlparse / engine / grouping.py View on Github external
def match(token):
        return imt(token, t=(T.Operator, T.Wildcard))
github mtxr / SublimeText-SQLTools / SQLToolsAPI / lib / sqlparse / sql.py View on Github external
funcs = lambda tk: not ((skip_ws and tk.is_whitespace()) or
                                (skip_cm and imt(tk, t=T.Comment, i=Comment)))
        return self._token_matching(funcs, idx, reverse=_reverse)
github mtxr / SublimeText-SQLTools / SQLToolsAPI / lib / sqlparse / engine / grouping.py View on Github external
def post(tlist, pidx, tidx, nidx):
        # next_ validation is being performed here. issue261
        sqlcls = sql.SquareBrackets, sql.Function
        ttypes = T.Name, T.String.Symbol, T.Wildcard
        next_ = tlist[nidx] if nidx is not None else None
        valid_next = imt(next_, i=sqlcls, t=ttypes)

        return (pidx, nidx) if valid_next else (pidx, tidx)
github mtxr / SublimeText-SQLTools / sqlparse / sql.py View on Github external
funcs = lambda tk: not ((skip_ws and tk.is_whitespace()) or
                                (skip_cm and imt(tk, t=T.Comment, i=Comment)))
        return self._token_matching(funcs, idx, reverse=_reverse)
github mtxr / SublimeText-SQLTools / SQLToolsAPI / lib / sqlparse / sql.py View on Github external
def get_parameters(self):
        """Return a list of parameters."""
        parenthesis = self.tokens[-1]
        for token in parenthesis.tokens:
            if isinstance(token, IdentifierList):
                return token.get_identifiers()
            elif imt(token, i=(Function, Identifier), t=T.Literal):
                return [token, ]
        return []