Skip to content

Commit 13435a9

Browse files
committed
Merge pull request #541 from tomasikp/master
Warning for custom typeCast callbacks
2 parents c87ba17 + e76dc97 commit 13435a9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Readme.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -850,9 +850,21 @@ connection.query({
850850
}
851851
});
852852
```
853+
__WARNING: YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once.( see #539 for discussion)__
854+
855+
```
856+
field.string()
857+
field.buffer()
858+
field.geometry()
859+
```
860+
are aliases for
861+
```
862+
parser.parseLengthCodedString()
863+
parser.parseLengthCodedBuffer()
864+
parser.parseGeometryValue()
865+
```
866+
__You can find which field function you need to use by looking at: [RowDataPacket.prototype._typeCast](https://github.com/felixge/node-mysql/blob/master/lib/protocol/packets/RowDataPacket.js#L41)__
853867

854-
If you need a buffer there's also a `.buffer()` function and also a `.geometry()` one
855-
both used by the default type cast that you can use.
856868

857869
## Connection Flags
858870

0 commit comments

Comments
 (0)