Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

doc: add skeletons for *_with_timestamp_column #1220

Merged
merged 3 commits into from
Jan 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions google/cloud/spanner/samples/samples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,33 @@ void CreateTableWithTimestamp(
}
// [END spanner_create_table_with_timestamp_column]

// [START spanner_insert_data_with_timestamp_column]
void InsertDataWithTimestamp(
google::cloud::spanner::DatabaseAdminClient client,
std::string const& project_id, std::string const& instance_id,
std::string const& database_id) {
// TODO(#1217)
}
// [END spanner_insert_data_with_timestamp_column]

// [START spanner_update_data_with_timestamp_column]
void UpdateDataWithTimestamp(
google::cloud::spanner::DatabaseAdminClient client,
std::string const& project_id, std::string const& instance_id,
std::string const& database_id) {
// TODO(#1218)
}
// [END spanner_update_data_with_timestamp_column]

// [START spanner_query_data_with_timestamp_column]
void QueryDataWithTimestamp(
google::cloud::spanner::DatabaseAdminClient client,
std::string const& project_id, std::string const& instance_id,
std::string const& database_id) {
// TODO(#1219)
}
// [END spanner_query_data_with_timestamp_column]

// [START spanner_create_index]
void AddIndex(google::cloud::spanner::DatabaseAdminClient client,
std::string const& project_id, std::string const& instance_id,
Expand Down Expand Up @@ -1825,6 +1852,12 @@ int RunOneCommand(std::vector<std::string> argv) {
make_database_command_entry("create-database", &CreateDatabase),
make_database_command_entry("create-table-with-timestamp",
&CreateTableWithTimestamp),
make_database_command_entry("insert-data-with-timestamp",
&InsertDataWithTimestamp),
make_database_command_entry("update-data-with-timestamp",
&UpdateDataWithTimestamp),
make_database_command_entry("query-data-with-timestamp",
&QueryDataWithTimestamp),
make_database_command_entry("add-index", &AddIndex),
make_database_command_entry("add-storing-index", &AddStoringIndex),
make_database_command_entry("get-database", &GetDatabase),
Expand Down Expand Up @@ -2003,6 +2036,18 @@ void RunAll() {
CreateTableWithTimestamp(database_admin_client, project_id, instance_id,
database_id);

std::cout << "\nRunning spanner_insert_data_with_timestamp_column sample\n";
InsertDataWithTimestamp(database_admin_client, project_id, instance_id,
database_id);

std::cout << "\nRunning spanner_update_data_with_timestamp_column sample\n";
UpdateDataWithTimestamp(database_admin_client, project_id, instance_id,
database_id);

std::cout << "\nRunning spanner_query_data_with_timestamp_column sample\n";
QueryDataWithTimestamp(database_admin_client, project_id, instance_id,
database_id);

std::cout << "\nRunning spanner_create_index sample\n";
AddIndex(database_admin_client, project_id, instance_id, database_id);

Expand Down