[DB-SIG] API suggestion: expose 'quote' method

Chris Cogdon chris at cogdon.org
Tue Jun 3 18:07:08 EDT 2003


On Tuesday, Jun 3, 2003, at 16:54 US/Pacific, David Rushby wrote:

> I phrased that poorly.  I meant that some DBMSes "have a quoting 
> convention",
> yet don't expose it in their *native* C clients APIs,

Actually, I don't expect any DBMS client library to expose a quoting 
function. They tend to be very minimalist :)

> which makes exposure in
> the Python driver immaterial (unless the author of the Python driver 
> were to
> write his own quoting code, which would be error-prone and likely to 
> break or
> not be extended to new data types across DBMS versions).

That's the python driver writer's JOB, to support changes in the 
underlying DBMS, making those changes invisible to the application 
writer. Inside the python driver is EXACTLY the right place for this 
function. Yes, if something breaks, the application writer can always 
substitute new, working code, but that's not the ideal solution. It 
belongs in the python driver.

If the DMBS client library is nice enough to supply a quoting function 
(either detecting or not detecting types), then the python driver 
writer could very well use the function if he or she wished, of course.

Additionally, if new data types were added, then applications using the 
driver would simply not have access to these types until the driver was 
changed. What's the problem, here?


-- 
    ("`-/")_.-'"``-._        Chris Cogdon <chris at cogdon.org>
     . . `; -._    )-;-,_`)
    (v_,)'  _  )`-.\  ``-'
   _.- _..-_/ / ((.'
((,.-'   ((,/   fL




More information about the DB-SIG mailing list