File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -250,8 +250,9 @@ module.exports =
250250 var instance = undefined ;
251251 options = options || { } ;
252252 options . with = options . with || [ ] ;
253+ var table = getTable ( resourceConfig ) ;
253254 var query = options && options . transaction || this . query ;
254- return query . select ( ' *') . from ( getTable ( resourceConfig ) ) . where ( resourceConfig . idAttribute , ( 0 , _lang . toString ) ( id ) ) . then ( function ( rows ) {
255+ return query . select ( table + '. *') . from ( table ) . where ( table + '.' + resourceConfig . idAttribute , ( 0 , _lang . toString ) ( id ) ) . then ( function ( rows ) {
255256 if ( ! rows . length ) {
256257 return _bluebird2 . default . reject ( new Error ( 'Not Found!' ) ) ;
257258 } else {
@@ -464,7 +465,7 @@ module.exports =
464465 if ( v === null ) {
465466 query = query . whereNull ( field ) ;
466467 } else {
467- query . where ( field , v ) ;
468+ query = query . where ( field , v ) ;
468469 }
469470 } else if ( op === '!=' || op === '!==' ) {
470471 if ( v === null ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " js-data-sql" ,
33 "description" : " Postgres/MySQL/MariaDB/SQLite3 adapter for js-data." ,
4- "version" : " 0.11.9 " ,
4+ "version" : " 0.11.12 " ,
55 "homepage" : " http://www.js-data.io/docs/dssqladapter" ,
66 "repository" : {
77 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -174,11 +174,12 @@ class DSSqlAdapter {
174174 let instance
175175 options = options || { }
176176 options . with = options . with || [ ]
177+ let table = getTable ( resourceConfig ) ;
177178 let query = options && options . transaction || this . query
178179 return query
179- . select ( '*' )
180- . from ( getTable ( resourceConfig ) )
181- . where ( resourceConfig . idAttribute , toString ( id ) )
180+ . select ( ` ${ table } .*` )
181+ . from ( table )
182+ . where ( ` ${ table } . ${ resourceConfig . idAttribute } ` , toString ( id ) )
182183 . then ( rows => {
183184 if ( ! rows . length ) {
184185 return Promise . reject ( new Error ( 'Not Found!' ) )
@@ -362,7 +363,7 @@ class DSSqlAdapter {
362363 if ( v === null ) {
363364 query = query . whereNull ( field )
364365 } else {
365- query . where ( field , v )
366+ query = query . where ( field , v )
366367 }
367368 } else if ( op === '!=' || op === '!==' ) {
368369 if ( v === null ) {
You can’t perform that action at this time.
0 commit comments