
    Dvg	                     ~    d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dZg d	Z	ddZ
ddZddZddZd
S )zParse SQL statements.    )sql)cli)engine)tokens)filters)	formatterz0.5.3)r   r   r   r   r   r   Nc                 <    t          t          | |                    S )zParse 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   encodings     N/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/sqlparse/__init__.pyparser      s     S(++,,,    c                 |    t          j                    }|                                 |                    | |          S )zParses 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   stacks      r   r   r   !   s8       E	99VX&&&r   c                 "   t          j                    }t          j        |          }t          j        ||          }|j                            t          j                               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   s       r   formatr   -   st       E(11G(88E	W68899977599S(++,,,r   Fc                 l    t          j        |          }d |                    | |          D             S )a$  Split *sql* into single statements.

    :param sql: A string containing one or more SQL statements.
    :param encoding: The encoding of the statement (optional).
    :param strip_semicolon: If True, remove trainling semicolons
        (default: False).
    :returns: A list of strings.
    )strip_semicolonc                 P    g | ]#}t          |                                          $S  )strstrip).0stmts     r   
<listcomp>zsplit.<locals>.<listcomp>H   s(    CCC$CIIOOCCCr   )r   r   r   )r   r   r!   r   s       r   splitr)   >   s9     ???ECC%))C*B*BCCCCr   )N)NF)__doc__sqlparser   r   r   r   r   r   __version____all__r   r   r   r)   r#   r   r   <module>r.      s                                          
D
D
D- - - -	' 	' 	' 	'- - - -"
D 
D 
D 
D 
D 
Dr   