@@ -4,15 +4,15 @@ var TYPES = require('tedious').TYPES;
44/* GET task listing. */
55router . get ( '/' , function ( req , res ) {
66
7- req . query ( "select * from todo for json path" )
7+ req . sql ( "select * from todo for json path" )
88 . into ( res , '[]' ) ;
99
1010} ) ;
1111
1212/* GET single task. */
1313router . get ( '/:id' , function ( req , res ) {
1414
15- req . query ( "select * from todo where id = @id for json path, without_array_wrapper" )
15+ req . sql ( "select * from todo where id = @id for json path, without_array_wrapper" )
1616 . param ( 'id' , req . params . id , TYPES . Int )
1717 . into ( res , '{}' ) ;
1818
@@ -21,7 +21,7 @@ router.get('/:id', function (req, res) {
2121/* POST create task. */
2222router . post ( '/' , function ( req , res ) {
2323
24- req . query ( "exec createTodo @todo" )
24+ req . sql ( "exec createTodo @todo" )
2525 . param ( 'todo' , req . body , TYPES . NVarChar )
2626 . exec ( res ) ;
2727
@@ -30,7 +30,7 @@ router.post('/', function (req, res) {
3030/* PUT update task. */
3131router . put ( '/:id' , function ( req , res ) {
3232
33- req . query ( "exec updateTodo @id, @todo" )
33+ req . sql ( "exec updateTodo @id, @todo" )
3434 . param ( 'id' , req . params . id , TYPES . Int )
3535 . param ( 'todo' , req . body , TYPES . NVarChar )
3636 . exec ( res ) ;
@@ -40,7 +40,7 @@ router.put('/:id', function (req, res) {
4040/* DELETE single task. */
4141router . delete ( '/:id' , function ( req , res ) {
4242
43- req . query ( "delete from todo where id = @id" )
43+ req . sql ( "delete from todo where id = @id" )
4444 . param ( 'id' , req . params . id , TYPES . Int )
4545 . exec ( res ) ;
4646
0 commit comments