@@ -453,7 +453,7 @@ describe('MySQLTable', () => {
453
453
const doneDataAndRaw = cbManager . registerCallback ( ) ;
454
454
const doneRowExists = cbManager . registerCallback ( ) ;
455
455
456
- testTable . insertIfNotExists ( { email : { __raw : '"three@email.com"' } } , [ 'email' ] , ( err , result ) => {
456
+ testTable . insertIfNotExists ( { email : MySQLPlus . raw ( '"three@email.com"' ) } , [ 'email' ] , ( err , result ) => {
457
457
if ( err ) throw err ;
458
458
result . affectedRows . should . equal ( 1 ) ;
459
459
result . insertId . should . equal ( 3 ) ;
@@ -464,15 +464,15 @@ describe('MySQLTable', () => {
464
464
doneOnlyRaw ( ) ;
465
465
} ) ;
466
466
467
- testTable . insertIfNotExists ( { id : 5 , email : { __raw : '"five@email.com"' } } , [ 'id' , 'email' ] , ( err , result ) => {
467
+ testTable . insertIfNotExists ( { id : 5 , email : MySQLPlus . raw ( '"five@email.com"' ) } , [ 'id' , 'email' ] , ( err , result ) => {
468
468
if ( err ) throw err ;
469
469
result . affectedRows . should . equal ( 1 ) ;
470
470
result . insertId . should . equal ( 5 ) ;
471
471
doneDataAndRaw ( ) ;
472
472
} ) ;
473
473
} ) ;
474
474
475
- testTable . insertIfNotExists ( { email : { __raw : '"one@email.com"' } } , [ 'email' ] , ( err , result ) => {
475
+ testTable . insertIfNotExists ( { email : MySQLPlus . raw ( '"one@email.com"' ) } , [ 'email' ] , ( err , result ) => {
476
476
if ( err ) throw err ;
477
477
result . affectedRows . should . equal ( 0 ) ;
478
478
doneRowExists ( ) ;
@@ -510,14 +510,14 @@ describe('MySQLTable', () => {
510
510
} ) ;
511
511
512
512
it ( 'should accept raw data to insert and not escape it' , ( ) => {
513
- const promiseNewRow = testTable . insertIfNotExists ( { email : { __raw : '"three@email.com"' } } , [ 'email' ] )
513
+ const promiseNewRow = testTable . insertIfNotExists ( { email : MySQLPlus . raw ( '"three@email.com"' ) } , [ 'email' ] )
514
514
. then ( result => {
515
515
result . affectedRows . should . equal ( 1 ) ;
516
516
result . insertId . should . equal ( 3 ) ;
517
517
518
518
return Promise . all ( [
519
519
testTable . select ( 'email' , 'WHERE id = 3' ) ,
520
- testTable . insertIfNotExists ( { id : 5 , email : { __raw : '"five@email.com"' } } , [ 'id' , 'email' ] ) ,
520
+ testTable . insertIfNotExists ( { id : 5 , email : MySQLPlus . raw ( '"five@email.com"' ) } , [ 'id' , 'email' ] ) ,
521
521
] ) ;
522
522
} )
523
523
. then ( results => {
@@ -527,7 +527,7 @@ describe('MySQLTable', () => {
527
527
results [ 1 ] . insertId . should . equal ( 5 ) ;
528
528
} ) ;
529
529
530
- const promiseRowExists = testTable . insertIfNotExists ( { email : { __raw : '"one@email.com"' } } , [ 'email' ] )
530
+ const promiseRowExists = testTable . insertIfNotExists ( { email : MySQLPlus . raw ( '"one@email.com"' ) } , [ 'email' ] )
531
531
. then ( result => {
532
532
result . affectedRows . should . equal ( 0 ) ;
533
533
} ) ;
0 commit comments