Closed themadcreator closed 10 years ago
Looks good. Any chance you can add a functional test to https://github.com/wvanbergen/node-vertica/blob/master/test/functional/copy_test.coffee ?
Unit tests added.
Looks like the unit test failed on node 0.8:
1) Vertica.Connection#copy should accept callbacks in a data handler function and call them in order:
Uncaught
AssertionError:
at Query.copySQL [as callback] (/home/travis/build/wvanbergen/node-vertica/test/functional/copy_test.coffee:81:14)
at Query.onReadyForQuery (/home/travis/build/wvanbergen/node-vertica/src/query.coffee:70:12)
at process.startup.processNextTick.process._tickCallback (node.js:245:9)
Are you using any node 0.10 specific features?
If this can only be supported in node 0.10 or higher, you can wrap the test in if require('semver').gte(process.version, '0.10.0')
(see the test below). I'd prefer it if it also works in 0.8 though.
Updated. You'll notice that in order for the callbacks to be called, we must use the signature:
socket.write(buffer, callback)
instead of
socket.write(buffer, null, callback)
because node v0.8.* does not check for the second signature type.
Also, I'm not sure what vertica versions you run your tests on, but the copy_test failure tests return an error code of V1001 for me, not 08000 (we are on vertica 6). Also, your error messages appear to be custom, so running these mocha tests won't work on any vertica instance other than yours.
Oops -- left in debugger statement accidentally.
The tests run against Vertica 7 (because that's the one available as community edition, so I can use it for an open source project like this). I guess the error codes have changed between those versions?
I see. If I make more changes, I'll set one of those up.
This enables users to receive notification when a COPY query has consumed the current data. This can be used to stream bulk data efficiently using a COPY query.
Example:
NOTES:
I regenerated the src using coffeescript 1.7.1, but some of the javascripts resources appeared to update even though I did not modify the coffee source.