@@ -26,7 +26,7 @@ authentication:
26
26
27
27
.. code-block :: bash
28
28
29
- gcloud beta auth application-default login
29
+ gcloud auth application-default login
30
30
31
31
32
32
#. When running on App Engine or Compute Engine, credentials are already
@@ -81,9 +81,9 @@ To run this sample:
81
81
82
82
$ python snippets.py
83
83
84
- usage: snippets.py [-h] [--database-name DATABASE_NAME ]
85
- instance_name
86
- {insert_data,query_data,read_data,update_data,read_write_transaction,query_data_with_index,read_data_with_index,read_data_with_storing_index}
84
+ usage: snippets.py [-h] [--database-id DATABASE_ID ]
85
+ instance_id
86
+ {create_database, insert_data,query_data,read_data,add_column, update_data,query_data_with_new_column, read_write_transaction,read_only_transaction,add_index, query_data_with_index,read_data_with_index,add_storing_index ,read_data_with_storing_index}
87
87
...
88
88
89
89
This application demonstrates how to do basic operations using Cloud
@@ -92,26 +92,42 @@ To run this sample:
92
92
For more information, see the README.rst under /spanner.
93
93
94
94
positional arguments:
95
- instance_name Your Cloud Spanner instance name.
96
- {insert_data,query_data,read_data,update_data,read_write_transaction,query_data_with_index,read_data_with_index,read_data_with_storing_index}
95
+ instance_id Your Cloud Spanner instance ID.
96
+ {create_database,insert_data,query_data,read_data,add_column,update_data,query_data_with_new_column,read_write_transaction,read_only_transaction,add_index,query_data_with_index,read_data_with_index,add_storing_index,read_data_with_storing_index}
97
+ create_database Creates a database and tables for sample data.
97
98
insert_data Inserts sample data into the given database. The
98
99
database and table must already exist and can be
99
100
created using ` create_database` .
100
101
query_data Queries sample data from the database using SQL.
101
102
read_data Reads sample data from the database.
103
+ add_column Adds a new column to the Albums table in the example
104
+ database.
102
105
update_data Updates sample data in the database. This updates the
103
106
` MarketingBudget` column which must be created before
104
- running this sample. Run the following query on your
105
- database to create the column: ALTER TABLE Albums ADD
106
- COLUMN MarketingBudget INT64
107
+ running this sample. You can add the column by running
108
+ the ` add_column` sample or by running this DDL
109
+ statement against your database: ALTER TABLE Albums
110
+ ADD COLUMN MarketingBudget INT64
111
+ query_data_with_new_column
112
+ Queries sample data from the database using SQL. This
113
+ sample uses the ` MarketingBudget` column. You can add
114
+ the column by running the ` add_column` sample or by
115
+ running this DDL statement against your database:
116
+ ALTER TABLE Albums ADD COLUMN MarketingBudget INT64
107
117
read_write_transaction
108
118
Performs a read-write transaction to update two sample
109
119
records in the database. This will transfer 200,000
110
- from the ` MarketingBudget` field for the first Album
111
- to the second Album. If the ` MarketingBudget` is too
120
+ from the ` MarketingBudget` field for the second Album
121
+ to the first Album. If the ` MarketingBudget` is too
112
122
low, it will raise an exception. Before running this
113
123
sample, you will need to run the ` update_data` sample
114
124
to populate the fields.
125
+ read_only_transaction
126
+ Reads data inside of a read-only transaction. Within
127
+ the read-only transaction, or " snapshot" , the
128
+ application sees consistent view of the database at a
129
+ particular timestamp.
130
+ add_index Adds a simple index to the example database.
115
131
query_data_with_index
116
132
Inserts sample data into the given database. The
117
133
database and table must already exist and can be
@@ -120,15 +136,16 @@ To run this sample:
120
136
Inserts sample data into the given database. The
121
137
database and table must already exist and can be
122
138
created using ` create_database` .
139
+ add_storing_index Adds an storing index to the example database.
123
140
read_data_with_storing_index
124
141
Inserts sample data into the given database. The
125
142
database and table must already exist and can be
126
143
created using ` create_database` .
127
144
128
145
optional arguments:
129
146
-h, --help show this help message and exit
130
- --database-name DATABASE_NAME
131
- Your Cloud Spanner database name .
147
+ --database-id DATABASE_ID
148
+ Your Cloud Spanner database ID .
132
149
133
150
134
151
0 commit comments