ó
|Ł*^c           @   s   d  Z  d Z d d l m Z d d l m Z d d l m Z d d l m Z d d  Z	 d d  Z
 d	   Z d d
  Z d d l m Z d   Z d S(   s   Parse SQL statements.s   0.1.18i˙˙˙˙(   t   engine(   t   filters(   t	   formatter(   t   SQLParseErrorc         C   s   t  t |  |   S(   ső   Parse sql and return a list of statements.

    :param sql: A string containting one or more SQL statements.
    :param encoding: The encoding of the statement (optional).
    :returns: A tuple of :class:`~sqlparse.sql.Statement` instances.
    (   t   tuplet   parsestream(   t   sqlt   encoding(    (    se   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/sqlparse/__init__.pyt   parse   s    c         C   s&   t  j   } | j   | j |  |  S(   sç   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    t   FilterStackt   full_analyzet   run(   t   streamR   t   stack(    (    se   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/sqlparse/__init__.pyR      s    
c         K   sn   | j  d d  } t j   } t j |  } t j | |  } | j j t	 j
    d j | j |  |   S(   s'  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   t    N(   t   popt   NoneR    R	   R   t   validate_optionst   build_filter_stackt   postprocesst   appendR   t   SerializerUnicodet   joinR   (   R   t   optionsR   R   (    (    se   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/sqlparse/__init__.pyt   format+   s    
c         C   sD   t  j   } t | _ g  | j |  |  D] } t |  j   ^ q( S(   sĘ   Split *sql* into single statements.

    :param sql: A string containting one or more SQL statements.
    :param encoding: The encoding of the statement (optional).
    :returns: A list of strings.
    (   R    R	   t   Truet   split_statementsR   t   unicodet   strip(   R   R   R   t   stmt(    (    se   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/sqlparse/__init__.pyt   split=   s    	(   t   StatementFilterc         C   s   t    } t | j d  |    S(   N(   R   t   listt   processR   (   R   t   splitter(    (    se   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/sqlparse/__init__.pyt   split2L   s    	N(   t   __doc__t   __version__t   sqlparseR    R   R   t   sqlparse.exceptionsR   R   R   R   R   R   t   sqlparse.engine.filterR   R#   (    (    (    se   /home/gitlab-runner/builds/8480fa44/0/bergerc/fluidmanager-web/art-framework/bin/sqlparse/__init__.pyt   <module>   s   
	