@@ -42,9 +42,9 @@ void test_vector(pqxx::connection &conn) {
4242
4343 pqxx::result res = tx.exec (" SELECT embedding FROM items ORDER BY embedding <-> $1" , {embedding2});
4444 assert_equal (res.size (), 3 );
45- assert_equal (res[ 0 ][ 0 ] .as <pgvector::Vector>(), embedding2);
46- assert_equal (res[ 1 ][ 0 ] .as <pgvector::Vector>(), embedding);
47- assert_equal (res[ 2 ][ 0 ] .as <std::optional<pgvector::Vector>>().has_value (), false );
45+ assert_equal (res. at ( 0 ). at ( 0 ) .as <pgvector::Vector>(), embedding2);
46+ assert_equal (res. at ( 1 ). at ( 0 ) .as <pgvector::Vector>(), embedding);
47+ assert_equal (res. at ( 2 ). at ( 0 ) .as <std::optional<pgvector::Vector>>().has_value (), false );
4848}
4949
5050void test_halfvec (pqxx::connection &conn) {
@@ -57,9 +57,9 @@ void test_halfvec(pqxx::connection &conn) {
5757
5858 pqxx::result res = tx.exec (" SELECT half_embedding FROM items ORDER BY half_embedding <-> $1" , {embedding2});
5959 assert_equal (res.size (), 3 );
60- assert_equal (res[ 0 ][ 0 ] .as <pgvector::HalfVector>(), embedding2);
61- assert_equal (res[ 1 ][ 0 ] .as <pgvector::HalfVector>(), embedding);
62- assert_equal (res[ 2 ][ 0 ] .as <std::optional<pgvector::HalfVector>>().has_value (), false );
60+ assert_equal (res. at ( 0 ). at ( 0 ) .as <pgvector::HalfVector>(), embedding2);
61+ assert_equal (res. at ( 1 ). at ( 0 ) .as <pgvector::HalfVector>(), embedding);
62+ assert_equal (res. at ( 2 ). at ( 0 ) .as <std::optional<pgvector::HalfVector>>().has_value (), false );
6363}
6464
6565void test_bit (pqxx::connection &conn) {
@@ -72,9 +72,9 @@ void test_bit(pqxx::connection &conn) {
7272
7373 pqxx::result res = tx.exec (" SELECT binary_embedding FROM items ORDER BY binary_embedding <~> $1" , pqxx::params{embedding2});
7474 assert_equal (res.size (), 3 );
75- assert_equal (res[ 0 ][ 0 ] .as <std::string>(), embedding2);
76- assert_equal (res[ 1 ][ 0 ] .as <std::string>(), embedding);
77- assert_equal (res[ 2 ][ 0 ] .as <std::optional<std::string>>().has_value (), false );
75+ assert_equal (res. at ( 0 ). at ( 0 ) .as <std::string>(), embedding2);
76+ assert_equal (res. at ( 1 ). at ( 0 ) .as <std::string>(), embedding);
77+ assert_equal (res. at ( 2 ). at ( 0 ) .as <std::optional<std::string>>().has_value (), false );
7878}
7979
8080void test_sparsevec (pqxx::connection &conn) {
@@ -87,9 +87,9 @@ void test_sparsevec(pqxx::connection &conn) {
8787
8888 pqxx::result res = tx.exec (" SELECT sparse_embedding FROM items ORDER BY sparse_embedding <-> $1" , {embedding2});
8989 assert_equal (res.size (), 3 );
90- assert_equal (res[ 0 ][ 0 ] .as <pgvector::SparseVector>(), embedding2);
91- assert_equal (res[ 1 ][ 0 ] .as <pgvector::SparseVector>(), embedding);
92- assert_equal (res[ 2 ][ 0 ] .as <std::optional<pgvector::SparseVector>>().has_value (), false );
90+ assert_equal (res. at ( 0 ). at ( 0 ) .as <pgvector::SparseVector>(), embedding2);
91+ assert_equal (res. at ( 1 ). at ( 0 ) .as <pgvector::SparseVector>(), embedding);
92+ assert_equal (res. at ( 2 ). at ( 0 ) .as <std::optional<pgvector::SparseVector>>().has_value (), false );
9393}
9494
9595void test_sparsevec_nnz (pqxx::connection &conn) {
@@ -126,8 +126,8 @@ void test_stream_to(pqxx::connection &conn) {
126126 stream.write_values (pgvector::Vector{{4 , 5 , 6 }});
127127 stream.complete ();
128128 pqxx::result res = tx.exec (" SELECT embedding FROM items ORDER BY id" );
129- assert_equal (res[ 0 ][ 0 ] .as <std::string>(), " [1,2,3]" );
130- assert_equal (res[ 1 ][ 0 ] .as <std::string>(), " [4,5,6]" );
129+ assert_equal (res. at ( 0 ). at ( 0 ) .as <std::string>(), " [1,2,3]" );
130+ assert_equal (res. at ( 1 ). at ( 0 ) .as <std::string>(), " [4,5,6]" );
131131}
132132
133133void test_precision (pqxx::connection &conn) {
@@ -138,7 +138,7 @@ void test_precision(pqxx::connection &conn) {
138138 tx.exec (" INSERT INTO items (embedding) VALUES ($1)" , {embedding});
139139 tx.exec (" SET extra_float_digits = 3" );
140140 pqxx::result res = tx.exec (" SELECT embedding FROM items ORDER BY id DESC LIMIT 1" );
141- assert_equal (res[ 0 ][ 0 ] .as <pgvector::Vector>(), embedding);
141+ assert_equal (res. at ( 0 ). at ( 0 ) .as <pgvector::Vector>(), embedding);
142142}
143143
144144void test_vector_to_string () {
0 commit comments