We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4651bed commit d6c018fCopy full SHA for d6c018f
examples/loading/example.js
@@ -35,13 +35,13 @@ function copyRow(stream, line) {
35
console.log(`Loading ${embeddings.length} rows`);
36
const stream = client.query(copyFrom('COPY items (embedding) FROM STDIN'));
37
for (const [i, embedding] of embeddings.entries()) {
38
+ const line = `${pgvector.toSql(embedding)}\n`;
39
+ await copyRow(stream, line);
40
+
41
// show progress
42
if (i % 10000 == 0) {
43
stdout.write('.');
44
}
-
- const line = `${pgvector.toSql(embedding)}\n`;
- await copyRow(stream, line);
45
46
47
stream.on('finish', async function () {
0 commit comments