Skip to content

Commit 1fe0c5f

Browse files
author
kevinhikaruevans
committed
support for POINT class
1 parent 048f2c1 commit 1fe0c5f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/protocol/SqlString.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ SqlString.escape = function(val, stringifyObjects, timeZone) {
3636
}
3737

3838
if (typeof val === 'object') {
39+
// for the mysql point class
40+
if(val.hasOwnProperty('x') && val.hasOwnProperty('y')) {
41+
return 'POINT(' + [val.x, val.y].map(parseFloat).join(',') + ')';
42+
}
3943
if (stringifyObjects) {
4044
val = val.toString();
4145
} else {

0 commit comments

Comments
 (0)