You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue today where I was trying to save an object with a text Key that included an apostrophe, such as: MIKE'S FAVORITE
At first I thought save was the problem but as it turns out, the issue is with GET, because it looks like the adapter first checks whether the record exists so it knows whether to insert or update. The code starts on line 118:
if(this.isArray(keyOrArray)){sql='SELECT id, value FROM '+this.record+" WHERE id IN ('"+keyOrArray.join("','")+"')"}else{sql='SELECT id, value FROM '+this.record+" WHERE id = '"+keyOrArray+"'"}
The key is just concatenated into the SQL. When I replaced + keyOrArray + with the ? and passed keyOrArray into the objectArguments on the executeSQL call at the end of the function, my insert suddenly worked as expected.
That alone is enough for me, but I'm sure it breaks the batch insert. Luckily, I don't need it, but I wanted to point it out in case there was a better way to do this.
The text was updated successfully, but these errors were encountered:
I ran into an issue today where I was trying to save an object with a text Key that included an apostrophe, such as: MIKE'S FAVORITE
At first I thought save was the problem but as it turns out, the issue is with GET, because it looks like the adapter first checks whether the record exists so it knows whether to insert or update. The code starts on line 118:
The key is just concatenated into the SQL. When I replaced + keyOrArray + with the ? and passed keyOrArray into the objectArguments on the executeSQL call at the end of the function, my insert suddenly worked as expected.
That alone is enough for me, but I'm sure it breaks the batch insert. Luckily, I don't need it, but I wanted to point it out in case there was a better way to do this.
The text was updated successfully, but these errors were encountered: