sqlx
sqlx copied to clipboard
BindNamed() should not be deprecated
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?
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.