It seems that database/sql in Go does not specify how your SQL driver might find parameters in the SQL string to replace into a query...

Or, as Santayana said: "Those who cannot remember the past are condemned to repeat it"...

<rant>
So of course I get to read "database/sql does not dictate any specific format for parameter markers in query strings, and pq uses the Postgres-native ordinal markers, as shown above. The same marker can be reused for the same parameter" which is awesome and wonderful, and completely different from the way other drivers will replace a ? as a lowest common denominator sort of thing, and which is actually used in the (super brief) examples in database/sql

Why, oh why, could the authors of database/sql not have written a specification that followed the best practice of other languages, such as allowing named parameters in the SQL, but whyever did they fail to specify the format, inevitably resulting in a lack of interoperability.

I mean: sure, we all know that the database probably won't interoperate due to $RANDOM_SQL_IMPLEMENTATION stupidity, but that should be more or less historic now and there is just no excuse for continuing to propagate that shit further.

</rant>

golang   sql   postgres   standards   rant