
                             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\
R                  5      rg)z%Command for spanner databases create.    )absolute_import)division)unicode_literalsN)database_operations)	databases)base)flags)resource_argsc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	Create   z Create a Cloud Spanner database.EXAMPLESa          To create an empty Cloud Spanner database, run:

          $ {command} testdb --instance=my-instance-id

        To create a Cloud Spanner database with populated schema, run:

          $ {command} testdb --instance=my-instance-id
              --ddl='CREATE TABLE mytable (a INT64, b INT64) PRIMARY KEY(a)'

        To create a Cloud Spanner database with the PostgreSQL dialect, run:

          $ {command} testdb --instance=my-instance-id
              --database-dialect=POSTGRESQL
        c                    [         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        U R                  R                  [        R                  5        [         R                  " U S5        [        R                  " SS9R	                  U 5        g)	zSee base class.z	to createaA  Semi-colon separated DDL (data definition language) statements to run inside the newly created database. If there is an error in any statement, the database is not created. This option is not supported for the PostgreSQL dialect. Full DDL specification is at https://cloud.google.com/spanner/docs/data-definition-language)	help_texta  Path of a file that contains semi-colon separated DDL (data definition language) statements to run inside the newly created database. If there is an error in any statement, the database is not created. This option is not supported for the PostgreSQL dialect. Full DDL specification is at https://cloud.google.com/spanner/docs/data-definition-language. 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.z$to create the Cloud Spanner databasezRThe SQL dialect of the Cloud Spanner Database. GOOGLE_STANDARD_SQL is the default.N)r
   AddDatabaseResourceArgr	   DdlAddToParserDdlFileProtoDescriptorsFiler   
ASYNC_FLAGdisplay_infoAddCacheUpdaterDatabaseCompleterAddKmsKeyResourceArgDatabaseDialect)parsers    'lib/surface/spanner/databases/create.pyArgsCreate.Args4   s     ((=	II O  {6"	MM  !,F 3	I k&OO'
''(?(?@&&v'MO	. k&    c                    UR                   R                  R                  5       nUR                  5       n[        R
                  " U5      n[        R                  " UUR                  [        R                  " U5      [        R                  " U5      UUR                  5      nUR                  (       a  U$ [        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Creating database)CONCEPTSdatabaseParseParentr
   GetAndValidateKmsKeyNamer   r   r	   SplitDdlIntoStatementsGetProtoDescriptorsdatabase_dialectasync_r   Await)selfargsdatabase_refinstance_refkms_key_name_or_namesops         r   Run
Create.RunV   s     ==))//1L&&(L)BB4H			$$T*!!$'
B {{i$$R)<==r     N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r2   __static_attributes__r4   r    r   r   r      s<    ( 
//  -&  B>r    r   )r9   
__future__r   r   r   r:   googlecloudsdk.api_lib.spannerr   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.spannerr	   r
   CreateCommandr   r4   r    r   <module>rD      s9    , &  '  > 4 ( 4 <O>T O>r    