@@ -32,8 +32,8 @@ void test_vector(pqxx::connection &conn) {
3232 before_each (conn);
3333
3434 pqxx::nontransaction tx (conn);
35- auto embedding = pgvector::Vector ({1 , 2 , 3 });
36- auto embedding2 = pgvector::Vector ({4 , 5 , 6 });
35+ pgvector::Vector embedding ({1 , 2 , 3 });
36+ pgvector::Vector embedding2 ({4 , 5 , 6 });
3737 tx.exec (" INSERT INTO items (embedding) VALUES ($1), ($2), ($3)" , {embedding, embedding2, std::nullopt });
3838
3939 pqxx::result res = tx.exec (" SELECT embedding FROM items ORDER BY embedding <-> $1" , {embedding2});
@@ -47,8 +47,8 @@ void test_halfvec(pqxx::connection &conn) {
4747 before_each (conn);
4848
4949 pqxx::nontransaction tx (conn);
50- auto embedding = pgvector::HalfVector ({1 , 2 , 3 });
51- auto embedding2 = pgvector::HalfVector ({4 , 5 , 6 });
50+ pgvector::HalfVector embedding ({1 , 2 , 3 });
51+ pgvector::HalfVector embedding2 ({4 , 5 , 6 });
5252 tx.exec (" INSERT INTO items (half_embedding) VALUES ($1), ($2), ($3)" , {embedding, embedding2, std::nullopt });
5353
5454 pqxx::result res = tx.exec (" SELECT half_embedding FROM items ORDER BY half_embedding <-> $1" , {embedding2});
@@ -62,8 +62,8 @@ void test_bit(pqxx::connection &conn) {
6262 before_each (conn);
6363
6464 pqxx::nontransaction tx (conn);
65- std::string embedding = " 101" ;
66- std::string embedding2 = " 111" ;
65+ std::string embedding{ " 101" } ;
66+ std::string embedding2{ " 111" } ;
6767 tx.exec (" INSERT INTO items (binary_embedding) VALUES ($1), ($2), ($3)" , {embedding, embedding2, std::nullopt });
6868
6969 pqxx::result res = tx.exec (" SELECT binary_embedding FROM items ORDER BY binary_embedding <~> $1" , pqxx::params{embedding2});
@@ -77,8 +77,8 @@ void test_sparsevec(pqxx::connection &conn) {
7777 before_each (conn);
7878
7979 pqxx::nontransaction tx (conn);
80- auto embedding = pgvector::SparseVector ({1 , 2 , 3 });
81- auto embedding2 = pgvector::SparseVector ({4 , 5 , 6 });
80+ pgvector::SparseVector embedding ({1 , 2 , 3 });
81+ pgvector::SparseVector embedding2 ({4 , 5 , 6 });
8282 tx.exec (" INSERT INTO items (sparse_embedding) VALUES ($1), ($2), ($3)" , {embedding, embedding2, std::nullopt });
8383
8484 pqxx::result res = tx.exec (" SELECT sparse_embedding FROM items ORDER BY sparse_embedding <-> $1" , {embedding2});
@@ -93,7 +93,7 @@ void test_sparsevec_nnz(pqxx::connection &conn) {
9393
9494 pqxx::nontransaction tx (conn);
9595 std::vector<float > vec (16001 , 1 );
96- auto embedding = pgvector::SparseVector (vec);
96+ pgvector::SparseVector embedding (vec);
9797 assert_exception<pqxx::conversion_overrun>([&] {
9898 tx.exec (" INSERT INTO items (sparse_embedding) VALUES ($1)" , {embedding});
9999 }, " sparsevec cannot have more than 16000 dimensions" );
@@ -103,7 +103,7 @@ void test_stream(pqxx::connection &conn) {
103103 before_each (conn);
104104
105105 pqxx::nontransaction tx (conn);
106- auto embedding = pgvector::Vector ({1 , 2 , 3 });
106+ pgvector::Vector embedding ({1 , 2 , 3 });
107107 tx.exec (" INSERT INTO items (embedding) VALUES ($1)" , {embedding});
108108 int count = 0 ;
109109 for (auto [id, embedding2] : tx.stream <int , pgvector::Vector>(" SELECT id, embedding FROM items WHERE embedding IS NOT NULL" )) {
@@ -117,7 +117,7 @@ void test_stream_to(pqxx::connection &conn) {
117117 before_each (conn);
118118
119119 pqxx::nontransaction tx (conn);
120- auto stream = pqxx::stream_to::table (tx, {" items" }, {" embedding" });
120+ pqxx::stream_to stream = pqxx::stream_to::table (tx, {" items" }, {" embedding" });
121121 stream.write_values (pgvector::Vector ({1 , 2 , 3 }));
122122 stream.write_values (pgvector::Vector ({4 , 5 , 6 }));
123123 stream.complete ();
@@ -130,7 +130,7 @@ void test_precision(pqxx::connection &conn) {
130130 before_each (conn);
131131
132132 pqxx::nontransaction tx (conn);
133- auto embedding = pgvector::Vector ({1.23456789 , 0 , 0 });
133+ pgvector::Vector embedding ({1.23456789 , 0 , 0 });
134134 tx.exec (" INSERT INTO items (embedding) VALUES ($1)" , {embedding});
135135 tx.exec (" SET extra_float_digits = 3" );
136136 pqxx::result res = tx.exec (" SELECT embedding FROM items ORDER BY id DESC LIMIT 1" );
0 commit comments