sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

BindNamed() should not be deprecated

Open ZiyanK opened this issue 2 years ago • 1 comments

I want to be able to use the Named() function for postgresql but the return value only uses the ? bindvar and not '$' bindvar. BindNamed() allows me to specify the bindvar whichever I prefer.

https://github.com/jmoiron/sqlx/blob/master/named.go#L410

Is there any reason for it to be deprecated?

ZiyanK avatar Dec 09 '23 21:12 ZiyanK

I believe it's because not all databases support the $ syntax for named bindvars. While ? is support by all DBs. What the Named function provides is just a way for SQLX to do the substitution/ordering of bindvars for you.

jwendel avatar Feb 21 '24 05:02 jwendel