@@ -250,10 +250,10 @@ TEST_F(ClientIntegrationTest, RunTransaction) {
250250 // Insert SingerIds 100, 102, and 199.
251251 auto inserter = [](Client const &, Transaction const &) {
252252 auto isb =
253- InsertMutationBuilder (" Singers" , {" SingerId" , " FirstName" , " LastName" });
254- isb. AddRow ( MakeRow ( 100 , " first-name-100" , " last-name-100" ));
255- isb. AddRow ( MakeRow ( 102 , " first-name-102" , " last-name-102" ));
256- isb. AddRow ( MakeRow ( 199 , " first-name-199" , " last-name-199" ) );
253+ InsertMutationBuilder (" Singers" , {" SingerId" , " FirstName" , " LastName" })
254+ . EmplaceRow ( 100 , " first-name-100" , " last-name-100" )
255+ . EmplaceRow ( 102 , " first-name-102" , " last-name-102" )
256+ . EmplaceRow ( 199 , " first-name-199" , " last-name-199" );
257257 return Mutations{isb.Build ()};
258258 };
259259 auto insert_result = RunTransaction (*client_, {}, inserter);
@@ -373,8 +373,8 @@ void CheckReadWithOptions(
373373 Client client,
374374 std::function<Transaction::SingleUseOptions(CommitResult const &)> const &
375375 options_generator) {
376- using RowType = Row< std::int64_t , std::string, std::string >;
377- std::vector<RowType > expected_rows;
376+ using RowValues = std::vector<Value >;
377+ std::vector<RowValues > expected_rows;
378378 auto commit = RunTransaction (
379379 client, Transaction::ReadWriteOptions{},
380380 [&expected_rows](Client const &,
@@ -384,7 +384,8 @@ void CheckReadWithOptions(
384384 {" SingerId" , " FirstName" , " LastName" });
385385 for (int i = 1 ; i != 10 ; ++i) {
386386 auto s = std::to_string (i);
387- auto row = MakeRow (i, " test-fname-" + s, " test-lname-" + s);
387+ auto row = RowValues{Value (i), Value (" test-fname-" + s),
388+ Value (" test-lname-" + s)};
388389 insert.AddRow (row);
389390 expected_rows.push_back (row);
390391 }
@@ -397,14 +398,16 @@ void CheckReadWithOptions(
397398 {" SingerId" , " FirstName" , " LastName" });
398399 ASSERT_STATUS_OK (reader);
399400
400- std::vector<RowType > actual_rows;
401+ std::vector<RowValues > actual_rows;
401402 if (reader) {
402403 int row_number = 0 ;
403- for (auto & row : reader->Rows <RowType>()) {
404+ for (auto & row :
405+ reader->Rows <Row<std::int64_t , std::string, std::string>>()) {
404406 SCOPED_TRACE (" Reading row[" + std::to_string (row_number++) + " ]" );
405407 EXPECT_STATUS_OK (row);
406408 if (!row) break ;
407- actual_rows.push_back (*std::move (row));
409+ auto array = std::move (row)->values ();
410+ actual_rows.emplace_back (array.begin (), array.end ());
408411 }
409412 }
410413 EXPECT_THAT (actual_rows, UnorderedElementsAreArray (expected_rows));
@@ -454,8 +457,8 @@ void CheckExecuteQueryWithSingleUseOptions(
454457 Client client,
455458 std::function<Transaction::SingleUseOptions(CommitResult const &)> const &
456459 options_generator) {
457- using RowType = Row< std::int64_t , std::string, std::string >;
458- std::vector<RowType > expected_rows;
460+ using RowValues = std::vector<Value >;
461+ std::vector<RowValues > expected_rows;
459462 auto commit = RunTransaction (
460463 client, Transaction::ReadWriteOptions{},
461464 [&expected_rows](Client const &,
@@ -464,7 +467,8 @@ void CheckExecuteQueryWithSingleUseOptions(
464467 {" SingerId" , " FirstName" , " LastName" });
465468 for (int i = 1 ; i != 10 ; ++i) {
466469 auto s = std::to_string (i);
467- auto row = MakeRow (i, " test-fname-" + s, " test-lname-" + s);
470+ auto row = RowValues{Value (i), Value (" test-fname-" + s),
471+ Value (" test-lname-" + s)};
468472 insert.AddRow (row);
469473 expected_rows.push_back (row);
470474 }
@@ -476,13 +480,14 @@ void CheckExecuteQueryWithSingleUseOptions(
476480 options_generator (*commit),
477481 SqlStatement (" SELECT SingerId, FirstName, LastName FROM Singers" ));
478482
479- std::vector<RowType > actual_rows;
483+ std::vector<RowValues > actual_rows;
480484 int row_number = 0 ;
481- for (auto & row : reader.Rows <RowType >()) {
485+ for (auto & row : reader.Rows <Row<std:: int64_t , std::string, std::string> >()) {
482486 SCOPED_TRACE (" Reading row[" + std::to_string (row_number++) + " ]" );
483487 EXPECT_STATUS_OK (row);
484488 if (!row) break ;
485- actual_rows.push_back (*std::move (row));
489+ auto array = std::move (row)->values ();
490+ actual_rows.emplace_back (array.begin (), array.end ());
486491 }
487492
488493 EXPECT_THAT (actual_rows, UnorderedElementsAreArray (expected_rows));
@@ -531,9 +536,9 @@ TEST_F(ClientIntegrationTest, ExecuteQuery_ExactStaleness_Duration) {
531536 });
532537}
533538
534- StatusOr<std::vector<Row< std::int64_t , std::string, std::string >>>
535- AddSingerDataToTable ( Client const & client) {
536- std::vector<Row< std::int64_t , std::string, std::string >> expected_rows;
539+ StatusOr<std::vector<std::vector<Value >>> AddSingerDataToTable (
540+ Client const & client) {
541+ std::vector<std::vector<Value >> expected_rows;
537542 auto commit = RunTransaction (
538543 client, Transaction::ReadWriteOptions{},
539544 [&expected_rows](Client const &,
@@ -543,7 +548,8 @@ AddSingerDataToTable(Client const& client) {
543548 {" SingerId" , " FirstName" , " LastName" });
544549 for (int i = 1 ; i != 10 ; ++i) {
545550 auto s = std::to_string (i);
546- auto row = MakeRow (i, " test-fname-" + s, " test-lname-" + s);
551+ auto row = std::vector<Value>{Value (i), Value (" test-fname-" + s),
552+ Value (" test-lname-" + s)};
547553 insert.AddRow (row);
548554 expected_rows.push_back (row);
549555 }
@@ -572,21 +578,22 @@ TEST_F(ClientIntegrationTest, PartitionRead) {
572578 serialized_partitions.push_back (*serialized_partition);
573579 }
574580
575- using RowType = Row<std::int64_t , std::string, std::string>;
576- std::vector<RowType> actual_rows;
581+ std::vector<std::vector<Value>> actual_rows;
577582 int partition_number = 0 ;
578583 for (auto & partition : serialized_partitions) {
579584 int row_number = 0 ;
580585 auto deserialized_partition = DeserializeReadPartition (partition);
581586 ASSERT_STATUS_OK (deserialized_partition);
582- auto partition_result_set = client_->Read (*deserialized_partition);
583- ASSERT_STATUS_OK (partition_result_set);
584- for (auto & row : partition_result_set->Rows <RowType>()) {
587+ auto result_set = client_->Read (*deserialized_partition);
588+ ASSERT_STATUS_OK (result_set);
589+ for (auto & row :
590+ result_set->Rows <Row<std::int64_t , std::string, std::string>>()) {
585591 SCOPED_TRACE (" Reading partition[" + std::to_string (partition_number++) +
586592 " ] row[" + std::to_string (row_number++) + " ]" );
587593 EXPECT_STATUS_OK (row);
588594 if (!row) break ;
589- actual_rows.push_back (*std::move (row));
595+ auto array = std::move (row)->values ();
596+ actual_rows.emplace_back (array.begin (), array.end ());
590597 }
591598 }
592599
@@ -610,20 +617,21 @@ TEST_F(ClientIntegrationTest, PartitionQuery) {
610617 serialized_partitions.push_back (*serialized_partition);
611618 }
612619
613- using RowType = Row<std::int64_t , std::string, std::string>;
614- std::vector<RowType> actual_rows;
620+ std::vector<std::vector<Value>> actual_rows;
615621 int partition_number = 0 ;
616622 for (auto & partition : serialized_partitions) {
617623 int row_number = 0 ;
618624 auto deserialized_partition = DeserializeQueryPartition (partition);
619625 ASSERT_STATUS_OK (deserialized_partition);
620- auto partition_result_set = client_->ExecuteQuery (*deserialized_partition);
621- for (auto & row : partition_result_set.Rows <RowType>()) {
626+ auto result_set = client_->ExecuteQuery (*deserialized_partition);
627+ for (auto & row :
628+ result_set.Rows <Row<std::int64_t , std::string, std::string>>()) {
622629 SCOPED_TRACE (" Reading partition[" + std::to_string (partition_number++) +
623630 " ] row[" + std::to_string (row_number++) + " ]" );
624631 EXPECT_STATUS_OK (row);
625632 if (!row) break ;
626- actual_rows.push_back (*std::move (row));
633+ auto array = std::move (row)->values ();
634+ actual_rows.emplace_back (array.begin (), array.end ());
627635 }
628636 }
629637
0 commit comments