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 f08d07d commit 199eeadCopy full SHA for 199eead
test/integration/connection/test-query-options-object-stream.js
@@ -0,0 +1,28 @@
1
+var common = require('../../common');
2
+var connection = common.createConnection();
3
+var assert = require('assert');
4
+
5
+connection.connect();
6
7
+var rows = undefined;
8
+var fields = undefined;
9
+var query = connection.query({
10
+ sql: 'SELECT ?',
11
+ values: [ 1 ]
12
+});
13
+query.on('error', function (err) {
14
+ throw err;
15
16
+query.on('fields', function (_fields) {
17
+ fields = _fields;
18
19
+query.on('result', function (_rows) {
20
+ rows = [ _rows ];
21
22
23
+connection.end();
24
25
+process.on('exit', function() {
26
+ assert.deepEqual(rows, [{1: 1}]);
27
+ assert.equal(fields[0].name, '1');
28
0 commit comments