[DB-SIG] Re: [Python-Dev] database APIs

Ian Bicking ianb@colorstudy.com
05 Feb 2003 00:39:13 -0600


On Tue, 2003-02-04 at 05:36, Luke Kenneth Casson Leighton wrote:
> On Mon, Feb 03, 2003 at 05:14:29PM -0600, Ian Bicking wrote:
> 
> > >  you might want to put in a per-class "string" handler
> > >  function.
> 
> > > [...]
> 
>  
> > I've avoided database-specific SQL generation, but perhaps it will be 
> > necessary at one point.  On these counts MySQL supports '' and \012, so 
> > the more complete quoting that MS-SQL demands could be implemented 
> > globally.
> 
>  ... can you guarantee that all SQL database systems likely to
>  be used will conform to a global string-handling system?

No, I can't guarantee anything.  But designing for hypotheticals is a
bad idea.  And there is a SQL standard, so not everything will be
database-specific.

> > Have you ever tried using Pyro (Python Remote Objects) or similar 
> > things for communicating over the wire?  
> 
>  ... no?
> 
>  i wrote the pyxsqmll code very quickly, cut/paste style from
>  andy dustman's mysqldb and from microsoft's examples on their
>  web site to do HTTP POSTs containing SQL queries.
> 
>  it's only 950 lines of code (and it shows :)
> 
>  requiring a dependency on a 130k download seems somewhat...
>  excessive?

I don't know, I haven't actually used Pyro before.  I suspect a lot of
that is documentation and tools you wouldn't use.  Anyway, there's other
remote object systems that are much more compact.  There's a whole
category on Parnassus: 
  http://py.vaults.ca/parnassus/apyllo.py?i=549099265

> 
> > I played around with similar 
> > stuff myself (though the database I was connecting too was ultimately 
> > too buggy), but later realized that I could have more easily exported 
> > those interfaces over the wire using a generic distributed-object 
> > system.
> 
>  ian, what are you proposing that pyro be used for?
> 
>  as a gateway to run a local python ODBC client on the MS-SQL server
>  that then passes the results over, with pyro doing all the
>  communication and stuff?

Yes, you'd have a small program on the MS-SQL server that would create a
connection.  That connection would be exported as a remote object, and
that would be it.  There wouldn't be any layer between the client and
the database connection (except the remote object system, but that would
hopefully seem fairly transparent).


-- 
Ian Bicking  ianb@colorstudy.com  http://colorstudy.com
4869 N. Talman Ave., Chicago, IL 60625  /  773-275-7241
"There is no flag large enough to cover the shame of 
 killing innocent people" -- Howard Zinn