@@ -65,9 +65,9 @@ describe('13. stream1.js', function () {
65
65
" END; \n" +
66
66
" EXECUTE IMMEDIATE (' \n" +
67
67
" CREATE TABLE nodb_employees ( \n" +
68
- " employees_id NUMBER, \n" +
69
- " employees_name VARCHAR2(20), \n" +
70
- " employees_history CLOB \n" +
68
+ " employee_id NUMBER, \n" +
69
+ " employee_name VARCHAR2(20), \n" +
70
+ " employee_history CLOB \n" +
71
71
" ) \n" +
72
72
" '); \n" +
73
73
"END; " ;
@@ -89,7 +89,7 @@ describe('13. stream1.js', function () {
89
89
" FOR i IN 1..217 LOOP \n" +
90
90
" x := x + 1; \n" +
91
91
" n := 'staff ' || x; \n" +
92
- " INSERT INTO nodb_employees VALUES (x, n, EMPTY_CLOB()) RETURNING employees_history INTO clobData; \n" +
92
+ " INSERT INTO nodb_employees VALUES (x, n, EMPTY_CLOB()) RETURNING employee_history INTO clobData; \n" +
93
93
" DBMS_LOB.WRITE(clobData, 20, 1, '12345678901234567890'); \n" +
94
94
" END LOOP; \n" +
95
95
"end; " ;
@@ -129,7 +129,7 @@ describe('13. stream1.js', function () {
129
129
it ( '13.1.1 stream results for oracle connection' , function ( done ) {
130
130
connection . should . be . ok ;
131
131
132
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
132
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
133
133
134
134
stream . on ( 'error' , function ( error ) {
135
135
should . fail ( error , null , 'Error event should not be triggered' ) ;
@@ -151,7 +151,7 @@ describe('13. stream1.js', function () {
151
151
it ( '13.1.2 stream results for oracle connection (outFormat: oracledb.OBJECT)' , function ( done ) {
152
152
connection . should . be . ok ;
153
153
154
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' , { } , {
154
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' , { } , {
155
155
outFormat : oracledb . OBJECT
156
156
} ) ;
157
157
@@ -190,7 +190,7 @@ describe('13. stream1.js', function () {
190
190
it ( '13.1.4 no result' , function ( done ) {
191
191
connection . should . be . ok ;
192
192
193
- var stream = connection . queryStream ( 'SELECT * FROM nodb_employees WHERE employees_name = :name' , {
193
+ var stream = connection . queryStream ( 'SELECT * FROM nodb_employees WHERE employee_name = :name' , {
194
194
name : 'TEST_NO_RESULT'
195
195
} ) ;
196
196
@@ -213,7 +213,7 @@ describe('13. stream1.js', function () {
213
213
it ( '13.1.5 single row' , function ( done ) {
214
214
connection . should . be . ok ;
215
215
216
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees WHERE employees_name = :name' , {
216
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees WHERE employee_name = :name' , {
217
217
name : 'staff 10'
218
218
} ) ;
219
219
@@ -239,7 +239,7 @@ describe('13. stream1.js', function () {
239
239
it ( '13.1.6 multiple row' , function ( done ) {
240
240
connection . should . be . ok ;
241
241
242
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees WHERE employees_id <= :maxId ORDER BY employees_id ' , {
242
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees WHERE employee_id <= :maxId ORDER BY employee_id ' , {
243
243
maxId : 10
244
244
} , {
245
245
outFormat : oracledb . OBJECT
@@ -253,7 +253,7 @@ describe('13. stream1.js', function () {
253
253
stream . on ( 'data' , function ( data ) {
254
254
should . exist ( data ) ;
255
255
should . deepEqual ( data , {
256
- EMPLOYEES_NAME : 'staff ' + ( counter + 1 )
256
+ EMPLOYEE_NAME : 'staff ' + ( counter + 1 )
257
257
} ) ;
258
258
259
259
counter ++ ;
@@ -269,7 +269,7 @@ describe('13. stream1.js', function () {
269
269
it ( '13.1.7 invalid SQL' , function ( done ) {
270
270
connection . should . be . ok ;
271
271
272
- var stream = connection . queryStream ( 'UPDATE nodb_employees SET employees_name = :name WHERE employees_id :id' , {
272
+ var stream = connection . queryStream ( 'UPDATE nodb_employees SET employee_name = :name WHERE employee_id = :id' , {
273
273
id : 10 ,
274
274
name : 'test_update'
275
275
} , {
@@ -290,7 +290,7 @@ describe('13. stream1.js', function () {
290
290
it ( '13.1.8 Read CLOBs' , function ( done ) {
291
291
connection . should . be . ok ;
292
292
293
- var stream = connection . queryStream ( 'SELECT employees_name, employees_history FROM nodb_employees where employees_id <= :maxId ORDER BY employees_id ' , {
293
+ var stream = connection . queryStream ( 'SELECT employee_name, employee_history FROM nodb_employees where employee_id <= :maxId ORDER BY employee_id ' , {
294
294
maxId : 10
295
295
} , {
296
296
outFormat : oracledb . OBJECT
@@ -307,18 +307,18 @@ describe('13. stream1.js', function () {
307
307
var rowIndex = counter ;
308
308
309
309
should . exist ( data ) ;
310
- should . equal ( data . EMPLOYEES_NAME , 'staff ' + ( rowIndex + 1 ) ) ;
310
+ should . equal ( data . EMPLOYEE_NAME , 'staff ' + ( rowIndex + 1 ) ) ;
311
311
312
- should . exist ( data . EMPLOYEES_HISTORY ) ;
313
- should . equal ( data . EMPLOYEES_HISTORY . constructor . name , 'Lob' ) ;
312
+ should . exist ( data . EMPLOYEE_HISTORY ) ;
313
+ should . equal ( data . EMPLOYEE_HISTORY . constructor . name , 'Lob' ) ;
314
314
315
315
var clob = [ ] ;
316
- data . EMPLOYEES_HISTORY . setEncoding ( 'utf8' ) ;
317
- data . EMPLOYEES_HISTORY . on ( 'data' , function ( data ) {
316
+ data . EMPLOYEE_HISTORY . setEncoding ( 'utf8' ) ;
317
+ data . EMPLOYEE_HISTORY . on ( 'data' , function ( data ) {
318
318
clob . push ( data ) ;
319
319
} ) ;
320
320
321
- data . EMPLOYEES_HISTORY . on ( 'end' , function ( ) {
321
+ data . EMPLOYEE_HISTORY . on ( 'end' , function ( ) {
322
322
clobs [ rowIndex ] = clob . join ( '' ) ;
323
323
should . equal ( clobs [ rowIndex ] , '12345678901234567890' ) ;
324
324
@@ -344,7 +344,7 @@ describe('13. stream1.js', function () {
344
344
345
345
this . timeout ( 10000 ) ;
346
346
347
- var stream = connection . queryStream ( 'SELECT employees_name, employees_history FROM nodb_employees where employees_id <= :maxId ORDER BY employees_id ' , {
347
+ var stream = connection . queryStream ( 'SELECT employee_name, employee_history FROM nodb_employees where employee_id <= :maxId ORDER BY employee_id ' , {
348
348
maxId : 10
349
349
} , {
350
350
outFormat : oracledb . OBJECT
@@ -362,20 +362,20 @@ describe('13. stream1.js', function () {
362
362
var rowIndex = counter ;
363
363
364
364
should . exist ( data ) ;
365
- should . equal ( data . EMPLOYEES_NAME , 'staff ' + ( rowIndex + 1 ) ) ;
365
+ should . equal ( data . EMPLOYEE_NAME , 'staff ' + ( rowIndex + 1 ) ) ;
366
366
367
- should . exist ( data . EMPLOYEES_HISTORY ) ;
368
- should . equal ( data . EMPLOYEES_HISTORY . constructor . name , 'Lob' ) ;
367
+ should . exist ( data . EMPLOYEE_HISTORY ) ;
368
+ should . equal ( data . EMPLOYEE_HISTORY . constructor . name , 'Lob' ) ;
369
369
370
370
var clob = [ ] ;
371
- data . EMPLOYEES_HISTORY . setEncoding ( 'utf8' ) ;
371
+ data . EMPLOYEE_HISTORY . setEncoding ( 'utf8' ) ;
372
372
373
373
setTimeout ( function ( ) {
374
- data . EMPLOYEES_HISTORY . on ( 'data' , function ( data ) {
374
+ data . EMPLOYEE_HISTORY . on ( 'data' , function ( data ) {
375
375
clob . push ( data ) ;
376
376
} ) ;
377
377
378
- data . EMPLOYEES_HISTORY . on ( 'end' , function ( ) {
378
+ data . EMPLOYEE_HISTORY . on ( 'end' , function ( ) {
379
379
clobs [ rowIndex ] = clob . join ( '' ) ;
380
380
should . equal ( clobs [ rowIndex ] , '12345678901234567890' ) ;
381
381
@@ -400,15 +400,15 @@ describe('13. stream1.js', function () {
400
400
it ( '13.1.10 meta data' , function ( done ) {
401
401
connection . should . be . ok ;
402
402
403
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees WHERE employees_name = :name' , {
403
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees WHERE employee_name = :name' , {
404
404
name : 'staff 10'
405
405
} ) ;
406
406
407
407
var metaDataRead = false ;
408
408
stream . on ( 'metadata' , function ( metaData ) {
409
409
should . deepEqual ( metaData , [
410
410
{
411
- name : 'EMPLOYEES_NAME '
411
+ name : 'EMPLOYEE_NAME '
412
412
}
413
413
] ) ;
414
414
metaDataRead = true ;
@@ -434,7 +434,7 @@ describe('13. stream1.js', function () {
434
434
435
435
connection . should . be . ok ;
436
436
437
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
437
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
438
438
439
439
stream . on ( 'error' , function ( error ) {
440
440
should . fail ( error , null , 'Error event should not be triggered' ) ;
@@ -453,7 +453,7 @@ describe('13. stream1.js', function () {
453
453
454
454
var testDone = 0 ;
455
455
var subTest = function ( callback ) {
456
- var query = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
456
+ var query = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
457
457
458
458
query . on ( 'error' , function ( error ) {
459
459
should . fail ( error , null , 'Error event should not be triggered' ) ;
@@ -493,7 +493,7 @@ describe('13. stream1.js', function () {
493
493
it ( '13.2.1 should be able to stop the stream early with _close' , function ( done ) {
494
494
connection . should . be . ok ;
495
495
496
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
496
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
497
497
498
498
stream . on ( 'data' , function ( ) {
499
499
stream . pause ( ) ;
@@ -516,7 +516,7 @@ describe('13. stream1.js', function () {
516
516
it ( '13.2.2 should be able to stop the stream before any data' , function ( done ) {
517
517
connection . should . be . ok ;
518
518
519
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
519
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
520
520
521
521
stream . on ( 'close' , function ( ) {
522
522
done ( ) ;
@@ -541,7 +541,7 @@ describe('13. stream1.js', function () {
541
541
it ( '13.2.3 should invoke an optional callback passed to _close' , function ( done ) {
542
542
connection . should . be . ok ;
543
543
544
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
544
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
545
545
546
546
stream . _close ( function ( ) {
547
547
done ( ) ;
@@ -572,7 +572,7 @@ describe('13. stream1.js', function () {
572
572
573
573
oracledb . maxRows = testMaxRows ;
574
574
575
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
575
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
576
576
577
577
stream . on ( 'data' , function ( ) {
578
578
stream . pause ( ) ;
@@ -596,7 +596,7 @@ describe('13. stream1.js', function () {
596
596
} ) ;
597
597
} ) ;
598
598
599
- it ( '13.3.2 should default to 100 if oracledb.maxRows is falsey ' , function ( done ) {
599
+ it ( '13.3.2 should default to 100 if oracledb.maxRows is false ' , function ( done ) {
600
600
var defaultMaxRows ;
601
601
var testMaxRows = 0 ;
602
602
@@ -606,7 +606,7 @@ describe('13. stream1.js', function () {
606
606
607
607
oracledb . maxRows = testMaxRows ;
608
608
609
- var stream = connection . queryStream ( 'SELECT employees_name FROM nodb_employees' ) ;
609
+ var stream = connection . queryStream ( 'SELECT employee_name FROM nodb_employees ORDER BY employee_name ' ) ;
610
610
611
611
stream . on ( 'data' , function ( ) {
612
612
stream . pause ( ) ;
0 commit comments