@@ -181,7 +181,7 @@ class Client {
181181 * not exist in the database; `Read` yields nothing for nonexistent rows.
182182 * @param columns The columns of `table` to be returned for each row matching
183183 * this request.
184- * @param read_options `ReadOptions ` used for this request.
184+ * @param opts `Options ` used for this request.
185185 *
186186 * @par Example
187187 * @snippet samples.cc read-data
@@ -190,8 +190,7 @@ class Client {
190190 * column value can exceed 10 MiB.
191191 */
192192 RowStream Read (std::string table, KeySet keys,
193- std::vector<std::string> columns,
194- ReadOptions read_options = {});
193+ std::vector<std::string> columns, Options opts = {});
195194
196195 /* *
197196 * @copydoc Read
@@ -201,33 +200,73 @@ class Client {
201200 */
202201 RowStream Read (Transaction::SingleUseOptions transaction_options,
203202 std::string table, KeySet keys,
204- std::vector<std::string> columns,
205- ReadOptions read_options = {});
203+ std::vector<std::string> columns, Options opts = {});
206204
207205 /* *
208206 * @copydoc Read
209207 *
210208 * @param transaction Execute this read as part of an existing transaction.
211209 */
212210 RowStream Read (Transaction transaction, std::string table, KeySet keys,
213- std::vector<std::string> columns,
214- ReadOptions read_options = {});
211+ std::vector<std::string> columns, Options opts = {});
215212 // @}
216213
214+ // / @name Backwards compatibility for `ReadOptions`.
215+ // /@{
216+ RowStream Read (std::string table, KeySet keys,
217+ std::vector<std::string> columns,
218+ ReadOptions const & read_options) {
219+ return Read (std::move (table), std::move (keys), std::move (columns),
220+ ToOptions (read_options));
221+ }
222+ RowStream Read (std::string table, KeySet keys,
223+ std::vector<std::string> columns,
224+ std::initializer_list<internal::NonConstructible>) {
225+ return Read (std::move (table), std::move (keys), std::move (columns));
226+ }
227+ RowStream Read (Transaction::SingleUseOptions transaction_options,
228+ std::string table, KeySet keys,
229+ std::vector<std::string> columns,
230+ ReadOptions const & read_options) {
231+ return Read (std::move (transaction_options), std::move (table),
232+ std::move (keys), std::move (columns), ToOptions (read_options));
233+ }
234+ RowStream Read (Transaction::SingleUseOptions transaction_options,
235+ std::string table, KeySet keys,
236+ std::vector<std::string> columns,
237+ std::initializer_list<internal::NonConstructible>) {
238+ return Read (std::move (transaction_options), std::move (table),
239+ std::move (keys), std::move (columns));
240+ }
241+ RowStream Read (Transaction transaction, std::string table, KeySet keys,
242+ std::vector<std::string> columns,
243+ ReadOptions const & read_options) {
244+ return Read (std::move (transaction), std::move (table), std::move (keys),
245+ std::move (columns), ToOptions (read_options));
246+ }
247+ RowStream Read (Transaction transaction, std::string table, KeySet keys,
248+ std::vector<std::string> columns,
249+ std::initializer_list<internal::NonConstructible>) {
250+ return Read (std::move (transaction), std::move (table), std::move (keys),
251+ std::move (columns));
252+ }
253+ // /@}
254+
217255 /* *
218256 * Reads rows from a subset of rows in a database. Requires a prior call
219257 * to `PartitionRead` to obtain the partition information; see the
220258 * documentation of that method for full details.
221259 *
222260 * @param partition A `ReadPartition`, obtained by calling `PartitionRead`.
261+ * @param opts `Options` used for this request.
223262 *
224263 * @note No individual row in the `ReadResult` can exceed 100 MiB, and no
225264 * column value can exceed 10 MiB.
226265 *
227266 * @par Example
228267 * @snippet samples.cc read-read-partition
229268 */
230- RowStream Read (ReadPartition const & partition);
269+ RowStream Read (ReadPartition const & partition, Options opts = {} );
231270
232271 /* *
233272 * Creates a set of partitions that can be used to execute a read
@@ -252,8 +291,7 @@ class Client {
252291 * not exist in the database; `Read` yields nothing for nonexistent rows.
253292 * @param columns The columns of `table` to be returned for each row matching
254293 * this request.
255- * @param read_options `ReadOptions` used for this request.
256- * @param partition_options `PartitionOptions` used for this request.
294+ * @param opts `Options` used for this request.
257295 *
258296 * @return A `StatusOr` containing a vector of `ReadPartition` or error
259297 * status on failure.
@@ -263,8 +301,27 @@ class Client {
263301 */
264302 StatusOr<std::vector<ReadPartition>> PartitionRead (
265303 Transaction transaction, std::string table, KeySet keys,
266- std::vector<std::string> columns, ReadOptions read_options = {},
267- PartitionOptions const & partition_options = PartitionOptions{});
304+ std::vector<std::string> columns, Options opts = {});
305+
306+ // / @name Backwards compatibility for `ReadOptions` and `PartitionOptions`.
307+ // /@{
308+ StatusOr<std::vector<ReadPartition>> PartitionRead (
309+ Transaction transaction, std::string table, KeySet keys,
310+ std::vector<std::string> columns, ReadOptions const & read_options,
311+ PartitionOptions const & partition_options) {
312+ return PartitionRead (std::move (transaction), std::move (table),
313+ std::move (keys), std::move (columns),
314+ internal::MergeOptions (ToOptions (read_options),
315+ ToOptions (partition_options)));
316+ }
317+ StatusOr<std::vector<ReadPartition>> PartitionRead (
318+ Transaction transaction, std::string table, KeySet keys,
319+ std::vector<std::string> columns,
320+ std::initializer_list<internal::NonConstructible>) {
321+ return PartitionRead (std::move (transaction), std::move (table),
322+ std::move (keys), std::move (columns));
323+ }
324+ // /@}
268325
269326 // @{
270327 /* *
@@ -474,7 +531,7 @@ class Client {
474531 * @param transaction The transaction to execute the operation in.
475532 * **Must** be a read-only snapshot transaction.
476533 * @param statement The SQL statement to execute.
477- * @param partition_options `PartitionOptions ` used for this request.
534+ * @param opts `Options ` used for this request.
478535 *
479536 * @return A `StatusOr` containing a vector of `QueryPartition`s or error
480537 * status on failure.
@@ -484,7 +541,22 @@ class Client {
484541 */
485542 StatusOr<std::vector<QueryPartition>> PartitionQuery (
486543 Transaction transaction, SqlStatement statement,
487- PartitionOptions const & partition_options = PartitionOptions{});
544+ Options opts = Options{});
545+
546+ // / @name Backwards compatibility for `PartitionOptions`.
547+ // /@{
548+ StatusOr<std::vector<QueryPartition>> PartitionQuery (
549+ Transaction transaction, SqlStatement statement,
550+ PartitionOptions const & partition_options) {
551+ return PartitionQuery (std::move (transaction), std::move (statement),
552+ ToOptions (partition_options));
553+ }
554+ StatusOr<std::vector<QueryPartition>> PartitionQuery (
555+ Transaction transaction, SqlStatement statement,
556+ std::initializer_list<internal::NonConstructible>) {
557+ return PartitionQuery (std::move (transaction), std::move (statement));
558+ }
559+ // /@}
488560
489561 /* *
490562 * Executes a SQL DML statement.
0 commit comments