mysqljs / sqlstring

Simple SQL escape and format for MySQL
MIT License
403 stars 78 forks source link

Clarify support for passing a string to the second argument of format #54

Closed lgarczyn closed 4 years ago

lgarczyn commented 4 years ago

Currently the calls format('?', 'test') and format('?', ['test']) appear to give the exact same result, however neither @types/sqlstring nor @types/mysql mention this feature.

Is it deprecated, unintended or simply undocumented?

dougwilson commented 4 years ago

Hi @lgarczyn , it is a deprecated way to pass just a single value, yes. It used to be in the docs, but I believe it was removed in order to discourage it's usage, as it was confusing on how it worked, especially when that single ? was itself an array.

lgarczyn commented 4 years ago

Thanks, that makes a whole lot of sense.