File: //lib/python3/dist-packages/sqlparse/__pycache__/__init__.cpython-310.pyc
o
;a� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dZg d �Z ddd�Z
dd
d�Zddd�Zddd�Z
d
S )zParse SQL statements.� )�sql)�cli)�engine)�tokens)�filters)� formatterz0.4.2)r r r r r r Nc C s t t| |��S )z�Parse sql and return a list of statements.
:param sql: A string containing one or more SQL statements.
:param encoding: The encoding of the statement (optional).
:returns: A tuple of :class:`~sqlparse.sql.Statement` instances.
)�tuple�parsestream)r �encoding� r �3/usr/lib/python3/dist-packages/sqlparse/__init__.py�parse s r
c C s t �� }|�� |�| |�S )z�Parses sql statements from file-like object.
:param stream: A file-like object.
:param encoding: The encoding of the stream contents (optional).
:returns: A generator of :class:`~sqlparse.sql.Statement` instances.
)r �FilterStack�enable_grouping�run)�streamr
�stackr r r r ! s r c K s@ t �� }t�|�}t�||�}|j�t�� � d� |�
| |��S )a' Format *sql* according to *options*.
Available options are documented in :ref:`formatting`.
In addition to the formatting options this function accepts the
keyword "encoding" which determines the encoding of the statement.
:returns: The formatted SQL statement as string.
� )r r r �validate_options�build_filter_stack�postprocess�appendr �SerializerUnicode�joinr )r r
�optionsr r r r �format- s
r c C s t �� }dd� |�| |�D �S )z�Split *sql* into single statements.
:param sql: A string containing one or more SQL statements.
:param encoding: The encoding of the statement (optional).
:returns: A list of strings.
c S s g | ]}t |��� �qS r )�str�strip)�.0�stmtr r r �
<listcomp>F s zsplit.<locals>.<listcomp>)r r r )r r
r r r r �split>