
                             S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJr  SSK	J
r
  SS	KJr  SS
KJr  SSKJr   " S S\
R                   5      rg)z)Command for spanner databases ddl update.    )absolute_import)division)unicode_literalsN)database_operations)	databases)base)flags)resource_args)logc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	Update   z,Update the DDL for a Cloud Spanner database.EXAMPLESz        To add a column to a table in the given Cloud Spanner database, run:

          $ {command} my-database-id --instance=my-instance-id
              --ddl='ALTER TABLE test_table ADD COLUMN a INT64'
        c                 B   [         R                  " U S5        [        R                  " SS9R	                  U 5        [        R
                  " SS9R	                  U 5        [        R                  " SS9R	                  U 5        [        R                  R	                  U 5        g)zSee base class.zof which the ddl to updatezSemi-colon separated DDL (data definition language) statements to run inside the database. If a statement fails, all subsequent statements in the batch are automatically cancelled.)	help_texta&  Path of a file containing semi-colon separated DDL (data definition language) statements to run inside the database. If a statement fails, all subsequent statements in the batch are automatically cancelled. If --ddl_file is set, --ddl is ignored. One line comments starting with -- are ignored.zPath of a file that contains a protobuf-serialized google.protobuf.FileDescriptorSet message. To generate it, install and run `protoc` with --include_imports and --descriptor_set_out.N)	r
   AddDatabaseResourceArgr	   DdlAddToParserDdlFileProtoDescriptorsFiler   
ASYNC_FLAG)parsers    +lib/surface/spanner/databases/ddl/update.pyArgsUpdate.Args,   s     ((1MN	II E  {6"	MM:;
 <G;v;N	I k&OO'    c                    [         R                  " UR                  R                  R	                  5       [
        R                  " U5      [
        R                  " U5      5      nUR                  (       a8  [        R                  R                  SR                  UR                  5      5      $ [        R                  " US5      $ )zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Some value that we want to have printed later.
z,Schema update in progress. Operation name={}zSchema updating)r   	UpdateDdlCONCEPTSdatabaseParser	   SplitDdlIntoStatementsGetProtoDescriptorsasync_r   statusPrintformatnamer   Await)selfargsops      r   Run
Update.RunB   s     
		T]]3399;"99$?"66t<
>B {{ZZ
8
?
?
HJ J$$R):;;r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r-   __static_attributes__r/   r   r   r   r      s;    4 
//  - ( (*<r   r   )r4   
__future__r   r   r   r5   googlecloudsdk.api_lib.spannerr   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.spannerr	   r
   googlecloudsdk.corer   UpdateCommandr   r/   r   r   <module>r@      s:    0 &  '  > 4 ( 4 < #3<T 3<r   