module documentation

pygments.lexers.sql ~~~~~~~~~~~~~~~~~~~ Lexers for various SQL dialects and related interactive sessions. Postgres specific lexers: `PostgresLexer` A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL lexer are: - keywords and data types list parsed from the PG docs (run the `_postgres_builtins` module to update them); - Content of $-strings parsed using a specific lexer, e.g. the content of a PL/Python function is parsed using the Python lexer; - parse PG specific constructs: E-strings, $-strings, U&-strings, different operators and punctuation. `PlPgsqlLexer` A lexer for the PL/pgSQL language. Adds a few specific construct on top of the PG SQL lexer (such as <<label>>). `PostgresConsoleLexer` A lexer to highlight an interactive psql session: - identifies the prompt and does its best to detect the end of command in multiline statement where not all the lines are prefixed by a prompt, telling them apart from the output; - highlights errors in the output and notification levels; - handles psql backslash commands. The ``tests/examplefiles`` contains a few test files with data to be parsed by these lexers. :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details.

Class lookahead Wrap an iterator and allow pushing back an item.
Class MySqlLexer The Oracle MySQL lexer.
Class PlPgsqlLexer Handle the extra syntax in Pl/pgSQL language.
Class PostgresBase Base class for Postgres-related lexers.
Class PostgresConsoleLexer Lexer for psql sessions.
Class PostgresLexer Lexer for the PostgreSQL dialect of SQL.
Class PsqlRegexLexer Extend the PostgresLexer adding support specific for psql commands.
Class RqlLexer Lexer for Relation Query Language.
Class SqliteConsoleLexer Lexer for example sessions using sqlite3.
Class SqlLexer Lexer for Structured Query Language. Currently, this lexer does not recognize any special syntax except ANSI SQL.
Class TransactSqlLexer Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to SQL.
Function language_callback Parse the content of a $-string using a lexer
Variable do_re Undocumented
Variable language_re Undocumented
Variable line_re Undocumented
Variable name_between_backtick_re Undocumented
Variable name_between_bracket_re Undocumented
Variable re_end_command Undocumented
Variable re_error Undocumented
Variable re_message Undocumented
Variable re_prompt Undocumented
Variable re_psql_command Undocumented
Variable sqlite_prompt_re Undocumented
Variable tsql_declare_re Undocumented
Variable tsql_go_re Undocumented
Variable tsql_variable_re Undocumented
def language_callback(lexer, match): (source)

Parse the content of a $-string using a lexer The lexer is chosen looking for a nearby LANGUAGE or assumed as plpgsql if inside a DO statement and no LANGUAGE has been found.

Undocumented

language_re = (source)

Undocumented

Undocumented

name_between_backtick_re = (source)

Undocumented

name_between_bracket_re = (source)

Undocumented

re_end_command = (source)

Undocumented

re_error = (source)

Undocumented

re_message = (source)

Undocumented

re_prompt = (source)

Undocumented

re_psql_command = (source)

Undocumented

sqlite_prompt_re = (source)

Undocumented

tsql_declare_re = (source)

Undocumented

tsql_go_re = (source)

Undocumented

tsql_variable_re = (source)

Undocumented