mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-25 16:03:13 +00:00
I believe you need to add "client.connect();" before actually running the stream thing; certainly this was necessary for me to get this code to work
parent
b97775d953
commit
89e99c149b
@ -325,6 +325,7 @@ Server expects from client sequence of rows encoded in CSV-like text. Rows can b
|
||||
Example:
|
||||
```javascript
|
||||
var client = new Client({user: 'brianc', database: 'test'});
|
||||
client.connect();
|
||||
var stream = client.copyFrom("COPY names (user_name, age) FROM STDIN WITH CSV");
|
||||
stream.on('close', function () {
|
||||
console.log("Data inserted sucessfully");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user