
    ,i9
              
       R   d Z ddlmZmZmZmZmZmZ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dl	mZ d	Zg d
Z	 ddedee   dee
j&                  df   fdZ	 ddeeee   f   dee   dee
j&                  ddf   fdZddedee   dedefdZ	 ddedee   dedee   fdZy)zParse SQL statements.    )Any	GeneratorIOListOptionalTupleUnion)sql)cli)engine)tokens)filters)	formatterz0.5.4)r   r   r   r
   r   r   Nr
   encodingreturn.c                 ,    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
   r   s     E/var/www/mymood/env/lib/python3.12/site-packages/sqlparse/__init__.pyparser      s     S(+,,    streamc                 n    t        j                         }|j                          |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)r   r   stacks      r   r   r   %   s/      E	99VX&&r   optionsc                    t        j                         }t        j                  |      }t        j                  ||      }|j
                  j                  t        j                                dj                  |j                  | |            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   r   r   s       r   formatr'   3   sk      E((1G((8E	W668977599S(+,,r   strip_semicolonc                     t        j                  |      }|j                  | |      D cg c]  }t        |      j	                          c}S c c}w )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 trailing semicolons
        (default: False).
    :returns: A list of strings.
    )r(   )r   r   r   strstrip)r
   r   r(   r   stmts        r   splitr-   D   sD     ?E*/))C*BC*B$CIOO*BCCCs    A)N)NF)__doc__typingr   r   r   r   r   r   r	   sqlparser
   r   r   r   r   r   __version____all__r*   	Statementr   r   r'   boolr-    r   r   <module>r6      s
    D C C       
D )-	-		- 	-
3==#	- <@'#r#w,'+3C='s}}dD()'- -x} - - -$ GLD	D D?CD	#YDr   