Skip to content

Commit 1da0f53

Browse files
authored
Spanner Batch Query Sample (#563)
* Spanner Batch Query Sample * ran linter
1 parent f0b81fc commit 1da0f53

File tree

5 files changed

+148
-54
lines changed

5 files changed

+148
-54
lines changed

spanner/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"src/create_storing_index.php",
2323
"src/query_data_with_new_column.php",
2424
"src/read_only_transaction.php",
25-
"src/read_stale_data.php"
25+
"src/read_stale_data.php",
26+
"src/batch_query_data.php"
2627
]
2728
}
2829
}

spanner/composer.lock

Lines changed: 54 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spanner/spanner.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,18 @@
216216
})
217217
);
218218

219+
// Batch query data command
220+
$application->add((new Command('batch-query-data'))
221+
->setDefinition($inputDefinition)
222+
->setDescription('Batch queries sample data from the database using SQL.')
223+
->setCode(function ($input, $output) {
224+
batch_query_data(
225+
$input->getArgument('instance_id'),
226+
$input->getArgument('database_id')
227+
);
228+
})
229+
);
230+
219231
// for testing
220232
if (getenv('PHPUNIT_TESTS') === '1') {
221233
return $application;

0 commit comments

Comments
 (0)