Skip to content

Commit

Permalink
Merge pull request #541 from tomasikp/master
Browse files Browse the repository at this point in the history
Warning for custom typeCast callbacks
  • Loading branch information
felixge committed Jul 12, 2013
2 parents c87ba17 + e76dc97 commit 13435a9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,21 @@ connection.query({
}
});
```
__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)__

```
field.string()
field.buffer()
field.geometry()
```
are aliases for
```
parser.parseLengthCodedString()
parser.parseLengthCodedBuffer()
parser.parseGeometryValue()
```
__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)__

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

## Connection Flags

Expand Down

0 comments on commit 13435a9

Please sign in to comment.