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 =
250
250
var instance = undefined ;
251
251
options = options || { } ;
252
252
options . with = options . with || [ ] ;
253
+ var table = getTable ( resourceConfig ) ;
253
254
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 ) {
255
256
if ( ! rows . length ) {
256
257
return _bluebird2 . default . reject ( new Error ( 'Not Found!' ) ) ;
257
258
} else {
@@ -464,7 +465,7 @@ module.exports =
464
465
if ( v === null ) {
465
466
query = query . whereNull ( field ) ;
466
467
} else {
467
- query . where ( field , v ) ;
468
+ query = query . where ( field , v ) ;
468
469
}
469
470
} else if ( op === '!=' || op === '!==' ) {
470
471
if ( v === null ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " js-data-sql" ,
3
3
"description" : " Postgres/MySQL/MariaDB/SQLite3 adapter for js-data." ,
4
- "version" : " 0.11.9 " ,
4
+ "version" : " 0.11.12 " ,
5
5
"homepage" : " http://www.js-data.io/docs/dssqladapter" ,
6
6
"repository" : {
7
7
"type" : " git" ,
Original file line number Diff line number Diff line change @@ -174,11 +174,12 @@ class DSSqlAdapter {
174
174
let instance
175
175
options = options || { }
176
176
options . with = options . with || [ ]
177
+ let table = getTable ( resourceConfig ) ;
177
178
let query = options && options . transaction || this . query
178
179
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 ) )
182
183
. then ( rows => {
183
184
if ( ! rows . length ) {
184
185
return Promise . reject ( new Error ( 'Not Found!' ) )
@@ -362,7 +363,7 @@ class DSSqlAdapter {
362
363
if ( v === null ) {
363
364
query = query . whereNull ( field )
364
365
} else {
365
- query . where ( field , v )
366
+ query = query . where ( field , v )
366
367
}
367
368
} else if ( op === '!=' || op === '!==' ) {
368
369
if ( v === null ) {
You can’t perform that action at this time.
0 commit comments