Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// based on code from Brian White @mscdex mariasql library - https://github.com/mscdex/node-mariasql/blob/master/lib/Client.js#L272-L332
// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE

var RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
var RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z_][a-zA-Z0-9_]*)))/g,
DQUOTE = 34,
SQUOTE = 39,
BSLASH = 92;
Expand Down
9 changes: 9 additions & 0 deletions test/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ it should replace ::name style placeholders with `??` placeholders
.should.eql([ 'normal placeholder ? and double semicolon ?? test', [ 'test1', 'test2' ] ]);
```

it should replace :name style placeholders that start with `_`

```js
var compile = require('..')();

query = 'normal placeholder :p1 and underscore-leading placeholder :_p2 test';
compile(query, {p1: 'test1', _p2: 'test2'})
.should.eql([ 'normal placeholder ? and underscore-leading placeholder ? test', [ 'test1', 'test2' ] ]);
```

# postgres-style toNumbered conversion

Expand Down