We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b534e15 commit 6d0bb6fCopy full SHA for 6d0bb6f
test/integration/connection/test-typecast-geometry.js
@@ -0,0 +1,27 @@
1
+var common = require('../../common');
2
+var connection = common.createConnection();
3
+var assert = require('assert');
4
+
5
+connection.query({
6
+ sql: 'select GeomFromText(\'POINT(11 0)\') as foo',
7
+ typeCast: function (field, next) {
8
+ if (field.type == 'GEOMETRY') {
9
+ return field.geometry();
10
+ }
11
+ return next();
12
13
+}, function(err, res) {
14
+ assert.ifError(err);
15
+ assert(Buffer.isBuffer(res[0].foo));
16
+});
17
18
19
20
21
+ typeCast: false
22
23
24
25
26
27
+connection.end();
0 commit comments