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) {
122
122
tx.commit ();
123
123
}
124
124
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
+
125
139
void test_precision (pqxx::connection &conn) {
126
140
before_each (conn);
127
141
@@ -144,6 +158,7 @@ int main() {
144
158
test_sparsevec (conn);
145
159
test_sparsevec_nnz (conn);
146
160
test_stream (conn);
161
+ test_stream_to (conn);
147
162
test_precision (conn);
148
163
149
164
return 0 ;
You can’t perform that action at this time.
0 commit comments