
    
                     ,   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dl	mZ  ej                  ej                  j                  ej                  j                  ej                  j                          G d	 d
ej"                               Zy)zExports data from a Cloud SQL instance to a CSV file.

Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a
plain text file with one line per row and comma-separated fields.
    )absolute_import)division)unicode_literals)api_util)base)export_util)flagsc                   &    e Zd ZdZed        Zd Zy)CsvzExports data from a Cloud SQL instance to a CSV file.

  Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a
  plain text file with one line per row and comma-separated fields.
  c                 (   t        j                  |        t        j                  |        | j	                  ddd       t        j
                  |        t        j                  |        t        j                  |        t        j                  |        y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    z--queryTzA SQL SELECT query (e.g., SELECT * FROM table) that specifies the data to export. WARNING: While in-transit, the query might be processed in intermediate locations other than the location of the target instance.)requiredhelpN)	r   AddBaseExportFlagsr	   AddOffloadArgumentadd_argumentAddQuoteArgumentAddEscapeArgumentAddFieldsDelimiterArgumentAddLinesDelimiterArgument)parsers    lib/surface/sql/export/csv.pyArgszCsv.Args(   sx     ""6*	V$
'  ( 
6"	F#	$$V,	##F+    c                 t    t        j                  t         j                        }t        j                  ||      S )z2Runs the command to export the Cloud SQL instance.)r   	SqlClientAPI_VERSION_DEFAULTr   RunCsvExportCommand)selfargsclients      r   RunzCsv.Run?   s+     < <=F**488r   N)__name__
__module____qualname____doc__staticmethodr   r!    r   r   r   r      s      , ,,9r   r   N)r%   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   r	   ReleaseTracksReleaseTrackGABETAALPHACommandr   r'   r   r   <module>r2      sx    '  ' / ( 6 0 D%%(($*;*;*@*@%%++-!9$,, !9-!9r   