sqlparse API reference
49 public APIs from sqlparse (andialbrecht/sqlparse) — 25 classes, 8 functions, 16 methods. Signatures extracted by static analysis of the actual source.
Repository: andialbrecht/sqlparse
| Kind | Count |
|---|---|
| Classes | 25 |
| Functions | 8 |
| Methods | 16 |
API list
class
sqlparse.engine.statement_splitter.StatementSplitterFilter that split stream at individual statements
method
sqlparse.engine.statement_splitter.StatementSplitter.process(stream)Process the stream
class
sqlparse.exceptions.SQLParseErrorBase class for exceptions in this module.
func
sqlparse.format(sql:str, encoding:str | None=None, **options:Any) -> strFormat *sql* according to *options*.
func
sqlparse.formatter.build_filter_stack(stack, options)Setup and return a filter stack.
func
sqlparse.formatter.validate_options(options)Validates options.
class
sqlparse.lexer.LexerThe Lexer supports configurable syntax.
method
sqlparse.lexer.Lexer.add_keywords(keywords)Add keyword dictionaries.
method
sqlparse.lexer.Lexer.clear()Clear all syntax configurations.
method
sqlparse.lexer.Lexer.is_keyword(value)Checks for a keyword.
func
sqlparse.lexer.tokenize(sql, encoding=None)Tokenize sql.
func
sqlparse.parse(sql:str, encoding:str | None=None) -> tuple[sql.Statement, ...]Parse sql and return a list of statements.
func
sqlparse.parsestream(stream:str | IO[str], encoding:str | None=None) -> Generator[sql.Statement, None, None]Parses sql statements from file-like object.
func
sqlparse.split(sql:str, encoding:str | None=None, strip_semicolon:bool=False) -> list[str]Split *sql* into single statements.
class
sqlparse.sql.AssignmentAn assignment like 'var := val;'
class
sqlparse.sql.BeginA BEGIN/END block.
class
sqlparse.sql.CaseA CASE statement with one or more WHEN and possibly an ELSE part.
class
sqlparse.sql.CommandGrouping of CLI commands.
class
sqlparse.sql.CommentA comment.
class
sqlparse.sql.ComparisonA comparison used for example in WHERE clauses.
class
sqlparse.sql.ForA 'FOR' loop.
class
sqlparse.sql.FunctionA function or procedure call.
method
sqlparse.sql.Function.get_parameters()Return a list of parameters.
method
sqlparse.sql.Function.get_window()Return the window if it exists.
class
sqlparse.sql.HavingA HAVING clause.
class
sqlparse.sql.IdentifierRepresents an identifier.
class
sqlparse.sql.IdentifierListA list of :class:`~sqlparse.sql.Identifier`'s.
method
sqlparse.sql.IdentifierList.get_identifiers()Returns the identifiers.
class
sqlparse.sql.IfAn 'if' clause with possible 'else if' or 'else' parts.
class
sqlparse.sql.NameAliasMixinImplements get_real_name and get_alias.
method
sqlparse.sql.NameAliasMixin.get_alias()Returns the alias for this identifier or ``None``.
class
sqlparse.sql.OperationGrouping of operations
class
sqlparse.sql.OverAn OVER clause.
class
sqlparse.sql.ParenthesisTokens between parenthesis.
class
sqlparse.sql.SquareBracketsTokens between square brackets
class
sqlparse.sql.StatementRepresents a SQL statement.
method
sqlparse.sql.Statement.get_type()Returns the type of a statement.
class
sqlparse.sql.TokenBase class for all other classes in this module.
method
sqlparse.sql.Token.flatten()Resolve subgroups.
class
sqlparse.sql.TokenListA group of tokens.
method
sqlparse.sql.TokenList.flatten()Generator yielding ungrouped tokens.
method
sqlparse.sql.TokenList.get_name()Returns the name of this identifier.
method
sqlparse.sql.TokenList.insert_after(where, token, skip_ws=True)Inserts *token* after *where*.
method
sqlparse.sql.TokenList.insert_before(where, token)Inserts *token* before *where*.
method
sqlparse.sql.TokenList.token_first(skip_ws=True, skip_cm=False)Returns the first child token.
method
sqlparse.sql.TokenList.token_index(token, start=0)Return list index of token.
class
sqlparse.sql.ValuesGrouping of values
class
sqlparse.sql.WhereA WHERE clause.
func
sqlparse.utils.consume(iterator, n)Advance the iterator n-steps ahead.
About this data
These signatures were extracted from the public source of andialbrecht/sqlparse
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.