1-
21.. This file is automatically generated. Do not edit this file directly.
32
43 Google Cloud Spanner Python Samples
@@ -15,12 +14,10 @@ This directory contains samples for Google Cloud Spanner. `Google Cloud Spanner`
1514
1615.. _Google Cloud Spanner : https://cloud.google.com/spanner/docs
1716
18-
1917Setup
2018-------------------------------------------------------------------------------
2119
2220
23-
2421Authentication
2522++++++++++++++
2623
@@ -31,9 +28,6 @@ credentials for applications.
3128.. _Authentication Getting Started Guide :
3229 https://cloud.google.com/docs/authentication/getting-started
3330
34-
35-
36-
3731Install Dependencies
3832++++++++++++++++++++
3933
@@ -48,7 +42,7 @@ Install Dependencies
4842 .. _Python Development Environment Setup Guide :
4943 https://cloud.google.com/python/setup
5044
51- #. Create a virtualenv. Samples are compatible with Python 3.6 +.
45+ #. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4 +.
5246
5347 .. code-block :: bash
5448
@@ -64,15 +58,9 @@ Install Dependencies
6458 .. _pip : https://pip.pypa.io/
6559.. _virtualenv : https://virtualenv.pypa.io/
6660
67-
68-
69-
70-
71-
7261Samples
7362-------------------------------------------------------------------------------
7463
75-
7664Snippets
7765+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7866
@@ -88,10 +76,32 @@ To run this sample:
8876
8977 $ python snippets.py
9078
91-
9279 usage: snippets.py [-h] [--database-id DATABASE_ID]
9380 instance_id
94- {create_instance,create_database,insert_data,delete_data,query_data,read_data,read_stale_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,create_table_with_timestamp,insert_data_with_timestamp,add_timestamp_column,update_data_with_timestamp,query_data_with_timestamp,write_struct_data,query_with_struct,query_with_array_of_struct,query_struct_field,query_nested_struct_field,insert_data_with_dml,update_data_with_dml,delete_data_with_dml,update_data_with_dml_timestamp,dml_write_read_transaction,update_data_with_dml_struct,insert_with_dml,query_data_with_parameter,write_with_dml_transaction,update_data_with_partitioned_dml,delete_data_with_partitioned_dml,update_with_batch_dml,create_table_with_datatypes,insert_datatypes_data,query_data_with_array,query_data_with_bool,query_data_with_bytes,query_data_with_date,query_data_with_float,query_data_with_int,query_data_with_string,query_data_with_timestamp_parameter,query_data_with_query_options,create_client_with_query_options}
81+ {create_database,insert_data,query_data,read_data,
82+ read_stale_data,add_column,update_data,
83+ query_data_with_new_column,read_write_transaction,
84+ read_only_transaction,add_index,query_data_with_index,
85+ read_data_with_index,add_storing_index,
86+ read_data_with_storing_index,
87+ create_table_with_timestamp,insert_data_with_timestamp,
88+ add_timestamp_column,update_data_with_timestamp,
89+ query_data_with_timestamp,write_struct_data,
90+ query_with_struct,query_with_array_of_struct,
91+ query_struct_field,query_nested_struct_field,
92+ insert_data_with_dml,update_data_with_dml,
93+ delete_data_with_dml,update_data_with_dml_timestamp,
94+ dml_write_read_transaction,update_data_with_dml_struct,
95+ insert_with_dml,query_data_with_parameter,
96+ write_with_dml_transaction,
97+ update_data_with_partitioned_dml,
98+ delete_data_with_partitioned_dml,update_with_batch_dml,
99+ create_table_with_datatypes,insert_datatypes_data,
100+ query_data_with_array,query_data_with_bool,
101+ query_data_with_bytes,query_data_with_date,
102+ query_data_with_float,query_data_with_int,
103+ query_data_with_string,
104+ query_data_with_timestamp_parameter}
95105 ...
96106
97107 This application demonstrates how to do basic operations using Cloud
@@ -101,15 +111,32 @@ To run this sample:
101111
102112 positional arguments:
103113 instance_id Your Cloud Spanner instance ID.
104- {create_instance,create_database,insert_data,delete_data,query_data,read_data,read_stale_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,create_table_with_timestamp,insert_data_with_timestamp,add_timestamp_column,update_data_with_timestamp,query_data_with_timestamp,write_struct_data,query_with_struct,query_with_array_of_struct,query_struct_field,query_nested_struct_field,insert_data_with_dml,update_data_with_dml,delete_data_with_dml,update_data_with_dml_timestamp,dml_write_read_transaction,update_data_with_dml_struct,insert_with_dml,query_data_with_parameter,write_with_dml_transaction,update_data_with_partitioned_dml,delete_data_with_partitioned_dml,update_with_batch_dml,create_table_with_datatypes,insert_datatypes_data,query_data_with_array,query_data_with_bool,query_data_with_bytes,query_data_with_date,query_data_with_float,query_data_with_int,query_data_with_string,query_data_with_timestamp_parameter,query_data_with_query_options,create_client_with_query_options}
105- create_instance Creates an instance.
114+ {create_database, insert_data, delete_data, query_data, read_data,
115+ read_stale_data, add_column, update_data, query_data_with_new_column,
116+ read_write_transaction, read_only_transaction, add_index,
117+ query_data_with_index, read_data_with_index, add_storing_index,
118+ read_data_with_storing_index, create_table_with_timestamp,
119+ insert_data_with_timestamp, add_timestamp_column,
120+ update_data_with_timestamp, query_data_with_timestamp,
121+ write_struct_data, query_with_struct, query_with_array_of_struct,
122+ query_struct_field, query_nested_struct_field, insert_data_with_dml,
123+ update_data_with_dml, delete_data_with_dml,
124+ update_data_with_dml_timestamp, dml_write_read_transaction,
125+ update_data_with_dml_struct, insert_with_dml, query_data_with_parameter,
126+ write_with_dml_transaction, update_data_with_partitioned_dml,
127+ delete_data_with_partitioned_dml, update_with_batch_dml,
128+ create_table_with_datatypes, insert_datatypes_data,
129+ query_data_with_array, query_data_with_bool, query_data_with_bytes,
130+ query_data_with_date, query_data_with_float, query_data_with_int,
131+ query_data_with_string, query_data_with_timestamp_parameter}
106132 create_database Creates a database and tables for sample data.
107133 insert_data Inserts sample data into the given database. The
108134 database and table must already exist and can be
109135 created using ` create_database` .
110136 delete_data Deletes sample data from the given database. The
111- database, table, and data must already exist and can
112- be created using ` create_database` and ` insert_data` .
137+ database, table, and data must already exist and
138+ can be created using ` create_database` and
139+ ` insert_data` .
113140 query_data Queries sample data from the database using SQL.
114141 read_data Reads sample data from the database.
115142 read_stale_data Reads sample data from the database. The data is
@@ -210,53 +237,59 @@ To run this sample:
210237 Deletes sample data from the database using a DML
211238 statement.
212239 update_data_with_dml_timestamp
213- Updates data with Timestamp from the database using a
214- DML statement.
240+ Updates data with Timestamp from the database using
241+ a DML statement.
215242 dml_write_read_transaction
216243 First inserts data then reads it from within a
217244 transaction using DML.
218245 update_data_with_dml_struct
219246 Updates data with a DML statement and STRUCT
220247 parameters.
221- insert_with_dml Inserts data with a DML statement into the database.
248+ insert_with_dml Inserts data with a DML statement into the
249+ database.
222250 query_data_with_parameter
223- Queries sample data from the database using SQL with a
224- parameter.
251+ Queries sample data from the database using SQL
252+ with a parameter.
225253 write_with_dml_transaction
226- Transfers part of a marketing budget from one album to
227- another.
254+ Transfers part of a marketing budget from one
255+ album to another.
228256 update_data_with_partitioned_dml
229- Update sample data with a partitioned DML statement.
257+ Update sample data with a partitioned DML
258+ statement.
230259 delete_data_with_partitioned_dml
231- Delete sample data with a partitioned DML statement.
260+ Delete sample data with a partitioned DML
261+ statement.
232262 update_with_batch_dml
233- Updates sample data in the database using Batch DML.
263+ Updates sample data in the database using Batch
264+ DML.
234265 create_table_with_datatypes
235266 Creates a table with supported dataypes.
236267 insert_datatypes_data
237268 Inserts data with supported datatypes into a table.
238269 query_data_with_array
239- Queries sample data using SQL with an ARRAY parameter.
270+ Queries sample data using SQL with an ARRAY
271+ parameter.
240272 query_data_with_bool
241- Queries sample data using SQL with a BOOL parameter.
273+ Queries sample data using SQL with a BOOL
274+ parameter.
242275 query_data_with_bytes
243- Queries sample data using SQL with a BYTES parameter.
276+ Queries sample data using SQL with a BYTES
277+ parameter.
244278 query_data_with_date
245- Queries sample data using SQL with a DATE parameter.
279+ Queries sample data using SQL with a DATE
280+ parameter.
246281 query_data_with_float
247282 Queries sample data using SQL with a FLOAT64
248283 parameter.
249284 query_data_with_int
250- Queries sample data using SQL with a INT64 parameter.
285+ Queries sample data using SQL with a INT64
286+ parameter.
251287 query_data_with_string
252- Queries sample data using SQL with a STRING parameter.
288+ Queries sample data using SQL with a STRING
289+ parameter.
253290 query_data_with_timestamp_parameter
254291 Queries sample data using SQL with a TIMESTAMP
255292 parameter.
256- query_data_with_query_options
257- Queries sample data using SQL with query options.
258- create_client_with_query_options
259- Create a client with query options.
260293
261294 optional arguments:
262295 -h, --help show this help message and exit
@@ -267,10 +300,6 @@ To run this sample:
267300
268301
269302
270-
271-
272-
273-
274303 The client library
275304-------------------------------------------------------------------------------
276305
@@ -286,5 +315,4 @@ to `browse the source`_ and `report issues`_.
286315 https://github.com/GoogleCloudPlatform/google-cloud-python/issues
287316
288317
289-
290- .. _Google Cloud SDK : https://cloud.google.com/sdk/
318+ .. _Google Cloud SDK : https://cloud.google.com/sdk/
0 commit comments