From 9a429d719e04f4a6f0cc1a09a9204db86582bef9 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 28 Feb 2018 17:14:19 -0800 Subject: [PATCH] Cleanup Spanner region tags. --- samples/crud.js | 20 ++++++++++---------- samples/indexing.js | 20 ++++++++++---------- samples/schema.js | 12 ++++++------ samples/transaction.js | 8 ++++---- src/database.js | 14 +++++++------- src/instance.js | 2 +- src/table.js | 12 ++++++------ 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/samples/crud.js b/samples/crud.js index 2ed421b6f..cc0a4d83f 100644 --- a/samples/crud.js +++ b/samples/crud.js @@ -16,7 +16,7 @@ 'use strict'; function updateData(instanceId, databaseId, projectId) { - // [START update_data] + // [START spanner_update_data] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -56,11 +56,11 @@ function updateData(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END update_data] + // [END spanner_update_data] } function insertData(instanceId, databaseId, projectId) { - // [START insert_data] + // [START spanner_insert_data] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -115,11 +115,11 @@ function insertData(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END insert_data] + // [END spanner_insert_data] } function queryData(instanceId, databaseId, projectId) { - // [START query_data] + // [START spanner_query_data] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -165,11 +165,11 @@ function queryData(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END query_data] + // [END spanner_query_data] } function readData(instanceId, databaseId, projectId) { - // [START read_data] + // [START spanner_read_data] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -220,11 +220,11 @@ function readData(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END read_data] + // [END spanner_read_data] } function readStaleData(instanceId, databaseId, projectId) { - // [START read_stale_data] + // [START spanner_read_stale_data] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -282,7 +282,7 @@ function readStaleData(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END read_stale_data] + // [END spanner_read_stale_data] } require(`yargs`) diff --git a/samples/indexing.js b/samples/indexing.js index fde6882a6..8c2f4f75d 100644 --- a/samples/indexing.js +++ b/samples/indexing.js @@ -16,7 +16,7 @@ 'use strict'; function createIndex(instanceId, databaseId, projectId) { - // [START create_index] + // [START spanner_create_index] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -57,11 +57,11 @@ function createIndex(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END create_index] + // [END spanner_create_index] } function createStoringIndex(instanceId, databaseId, projectId) { - // [START create_storing_index] + // [START spanner_create_storing_index] // "Storing" indexes store copies of the columns they index // This speeds up queries, but takes more space compared to normal indexes // See the link below for more information: @@ -109,7 +109,7 @@ function createStoringIndex(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END create_storing_index] + // [END spanner_create_storing_index] } function queryDataWithIndex( @@ -119,7 +119,7 @@ function queryDataWithIndex( endTitle, projectId ) { - // [START query_data_with_index] + // [START spanner_query_data_with_index] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -176,11 +176,11 @@ function queryDataWithIndex( // Close the database when finished. return database.close(); }); - // [END query_data_with_index] + // [END spanner_query_data_with_index] } function readDataWithIndex(instanceId, databaseId, projectId) { - // [START read_data_with_index] + // [START spanner_read_data_with_index] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -228,11 +228,11 @@ function readDataWithIndex(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END read_data_with_index] + // [END spanner_read_data_with_index] } function readDataWithStoringIndex(instanceId, databaseId, projectId) { - // [START read_data_with_storing_index] + // [START spanner_read_data_with_storing_index] // "Storing" indexes store copies of the columns they index // This speeds up queries, but takes more space compared to normal indexes // See the link below for more information: @@ -290,7 +290,7 @@ function readDataWithStoringIndex(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END read_data_with_storing_index] + // [END spanner_read_data_with_storing_index] } require(`yargs`) diff --git a/samples/schema.js b/samples/schema.js index a0c32c821..6db3f66a2 100644 --- a/samples/schema.js +++ b/samples/schema.js @@ -16,7 +16,7 @@ 'use strict'; function createDatabase(instanceId, databaseId, projectId) { - // [START create_database] + // [START spanner_create_database] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -70,11 +70,11 @@ function createDatabase(instanceId, databaseId, projectId) { .catch(err => { console.error('ERROR:', err); }); - // [END create_database] + // [END spanner_create_database] } function addColumn(instanceId, databaseId, projectId) { - // [START add_column] + // [START spanner_add_column] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -115,11 +115,11 @@ function addColumn(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END add_column] + // [END spanner_add_column] } function queryDataWithNewColumn(instanceId, databaseId, projectId) { - // [START query_data_with_new_column] + // [START spanner_query_data_with_new_column] // This sample uses the `MarketingBudget` column. You can add the column // by running the `add_column` sample or by running this DDL statement against // your database: @@ -173,7 +173,7 @@ function queryDataWithNewColumn(instanceId, databaseId, projectId) { // Close the database when finished. return database.close(); }); - // [END query_data_with_new_column] + // [END spanner_query_data_with_new_column] } require(`yargs`) diff --git a/samples/transaction.js b/samples/transaction.js index 4d94ab69a..4899c8824 100644 --- a/samples/transaction.js +++ b/samples/transaction.js @@ -16,7 +16,7 @@ 'use strict'; function readOnlyTransaction(instanceId, databaseId, projectId) { - // [START read_only_transaction] + // [START spanner_read_only_transaction] // Imports the Google Cloud client library const Spanner = require('@google-cloud/spanner'); @@ -91,11 +91,11 @@ function readOnlyTransaction(instanceId, databaseId, projectId) { return database.close(); }); }); - // [END read_only_transaction] + // [END spanner_read_only_transaction] } function readWriteTransaction(instanceId, databaseId, projectId) { - // [START read_write_transaction] + // [START spanner_read_write_transaction] // This sample transfers 200,000 from the MarketingBudget field // of the second Album to the first Album. Make sure to run the // addColumn and updateData samples first (in that order). @@ -203,7 +203,7 @@ function readWriteTransaction(instanceId, databaseId, projectId) { return database.close(); }); }); - // [END read_write_transaction] + // [END spanner_read_write_transaction] } require(`yargs`) diff --git a/src/database.js b/src/database.js index 15c9ff92b..e40aedb0e 100644 --- a/src/database.js +++ b/src/database.js @@ -735,11 +735,11 @@ Database.prototype.getTransaction = function(options, callback) { * }); * * @example include:samples/crud.js - * region_tag:query_data + * region_tag:spanner_query_data * Full example: * * @example include:samples/indexing.js - * region_tag:query_data_with_index + * region_tag:spanner_query_data_with_index * Querying data with an index: */ Database.prototype.run = function(query, options, callback) { @@ -1022,11 +1022,11 @@ Database.prototype.runStream = function(query, options) { * }); * * @example include:samples/transaction.js - * region_tag:read_only_transaction + * region_tag:spanner_read_only_transaction * Read-only transaction: * * @example include:samples/transaction.js - * region_tag:read_write_transaction + * region_tag:spanner_read_write_transaction * Read-write transaction: */ Database.prototype.runTransaction = function(options, runFn) { @@ -1142,15 +1142,15 @@ Database.prototype.table = function(name) { * }); * * @example include:samples/schema.js - * region_tag:add_column + * region_tag:spanner_add_column * Adding a column: * * @example include:samples/indexing.js - * region_tag:create_index + * region_tag:spanner_create_index * Creating an index: * * @example include:samples/indexing.js - * region_tag:create_storing_index + * region_tag:spanner_create_storing_index * Creating a storing index: */ Database.prototype.updateSchema = function(statements, callback) { diff --git a/src/instance.js b/src/instance.js index 93c1ab92f..dbc05fd90 100644 --- a/src/instance.js +++ b/src/instance.js @@ -297,7 +297,7 @@ Instance.formatName_ = function(projectId, name) { * }); * * @example include:samples/schema.js - * region_tag:create_database + * region_tag:spanner_create_database * Full example: */ Instance.prototype.createDatabase = function(name, options, callback) { diff --git a/src/table.js b/src/table.js index 2e0d56036..65f935e9e 100644 --- a/src/table.js +++ b/src/table.js @@ -371,7 +371,7 @@ Table.prototype.deleteRows = function(keys, callback) { * }); * * @example include:samples/crud.js - * region_tag:insert_data + * region_tag:spanner_insert_data * Full example: */ Table.prototype.insert = function(keyVals, callback) { @@ -513,19 +513,19 @@ Table.prototype.insert = function(keyVals, callback) { * }); * * @example include:samples/crud.js - * region_tag:read_data + * region_tag:spanner_read_data * Full example: * * @example include:samples/crud.js - * region_tag:read_stale_data + * region_tag:spanner_read_stale_data * Reading stale data: * * @example include:samples/indexing.js - * region_tag:read_data_with_index + * region_tag:spanner_read_data_with_index * Reading data using an index: * * @example include:samples/indexing.js - * region_tag:read_data_with_storing_index + * region_tag:spanner_read_data_with_storing_index * Reading data using a storing index: */ Table.prototype.read = function(keyVals, options, callback) { @@ -629,7 +629,7 @@ Table.prototype.replace = function(keyVals, callback) { * }); * * @example include:samples/crud.js - * region_tag:update_data + * region_tag:spanner_update_data * Full example: */ Table.prototype.update = function(keyVals, callback) {