I think it's the job of database/sql to extract any placeholders from the 
sql string and present them in a standardized way to each driver. It would 
be pointless if they had to reinvent the wheel every time. As for actually 
parsing SQL, it's not overly difficult. Obviously, search and replace isn't 
going to cut it :)

On Wednesday, November 9, 2016 at 5:21:04 PM UTC+2, mattn wrote:
>
>
> On Wednesday, November 9, 2016 at 6:00:45 PM UTC+9, Viktor Kojouharov 
> wrote:
>>
>> Why doesn't the change standardize the placeholder format? The driver can 
>> easily convert from a standard "[SOME-RUNE]PLACEHOLDER" to whatever the 
>> actual database supports. Having a non-standard format just introduces 
>> confusion and difficulty for the users of the api.
>>
>
> Not easy. The driver should parse SQL and replace placeholders in go.
>
> SELECT * FROM FOO WHERE NAME=':foo'
>
> Driver can't replace :foo because this is value not placeholder.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to