dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 377 forks source link

Implemented Named Parameters #496 #531

Open serkanserttop opened 10 years ago

serkanserttop commented 10 years ago

Named parameters facilitate building advanced queries. This implementation simply converts the sql statement into the version with “?” and builds an array of parameters to be passed in. Two tests are written and they are passing. There are few caveats as to how to use the function, but accounting for named parameter like text within quotes is not easy without writing a parser. The workaround provided for this rare case is to pass in custom regexes.