Skip to content

Commit

Permalink
Regenerate the README files and fix the Open in Cloud Shell link for …
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyumic authored Apr 7, 2018
1 parent a662787 commit cea767f
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions samples/samples/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This directory contains samples for Google Cloud Spanner. `Google Cloud Spanner`



.. _Google Cloud Spanner: https://cloud.google.com/spanner/docs
.. _Google Cloud Spanner: https://cloud.google.com/spanner/docs

Setup
-------------------------------------------------------------------------------
Expand Down Expand Up @@ -59,7 +59,7 @@ Snippets
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=spanner/cloud-client/snippets.py;spanner/cloud-client/README.rst
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=spanner/cloud-client/snippets.py,spanner/cloud-client/README.rst



Expand All @@ -72,7 +72,7 @@ To run this sample:
usage: snippets.py [-h] [--database-id DATABASE_ID]
instance_id
{create_database,insert_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_database,insert_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}
...
This application demonstrates how to do basic operations using Cloud
Expand All @@ -82,7 +82,7 @@ To run this sample:
positional arguments:
instance_id Your Cloud Spanner instance ID.
{create_database,insert_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_database,insert_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}
create_database Creates a database and tables for sample data.
insert_data Inserts sample data into the given database. The
database and table must already exist and can be
Expand Down Expand Up @@ -139,6 +139,34 @@ To run this sample:
Inserts sample data into the given database. The
database and table must already exist and can be
created using `create_database`.
create_table_with_timestamp
Creates a table with a COMMIT_TIMESTAMP column.
insert_data_with_timestamp
Inserts data with a COMMIT_TIMESTAMP field into a
table.
add_timestamp_column
Adds a new TIMESTAMP column to the Albums table in the
example database.
update_data_with_timestamp
Updates Performances tables in the database with the
COMMIT_TIMESTAMP column. This updates the
`MarketingBudget` column which must be created before
running this sample. You can add the column by running
the `add_column` sample or by running this DDL
statement against your database: ALTER TABLE Albums
ADD COLUMN MarketingBudget INT64 In addition this
update expects the LastUpdateTime column added by
applying this DDL statement against your database:
ALTER TABLE Albums ADD COLUMN LastUpdateTime TIMESTAMP
OPTIONS(allow_commit_timestamp=true)
query_data_with_timestamp
Queries sample data from the database using SQL. This
updates the `LastUpdateTime` column which must be
created before running this sample. You can add the
column by running the `add_timestamp_column` sample or
by running this DDL statement against your database:
ALTER TABLE Performances ADD COLUMN LastUpdateTime
TIMESTAMP OPTIONS (allow_commit_timestamp=true)
optional arguments:
-h, --help show this help message and exit
Expand Down

0 comments on commit cea767f

Please sign in to comment.