File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,20 @@ void test_stream(pqxx::connection &conn) {
122122 tx.commit ();
123123}
124124
125+ void test_stream_to (pqxx::connection &conn) {
126+ before_each (conn);
127+
128+ pqxx::work tx (conn);
129+ auto stream = pqxx::stream_to::table (tx, {" items" }, {" embedding" });
130+ stream << pgvector::Vector ({1 , 2 , 3 });
131+ stream << pgvector::Vector ({4 , 5 , 6 });
132+ stream.complete ();
133+ pqxx::result res = tx.exec (" SELECT embedding FROM items ORDER BY id" );
134+ assert (res[0 ][0 ].as <std::string>() == " [1,2,3]" );
135+ assert (res[1 ][0 ].as <std::string>() == " [4,5,6]" );
136+ tx.commit ();
137+ }
138+
125139void test_precision (pqxx::connection &conn) {
126140 before_each (conn);
127141
@@ -144,6 +158,7 @@ int main() {
144158 test_sparsevec (conn);
145159 test_sparsevec_nnz (conn);
146160 test_stream (conn);
161+ test_stream_to (conn);
147162 test_precision (conn);
148163
149164 return 0 ;
You can’t perform that action at this time.
0 commit comments