[Zope3-dev] Re: RDB support

Stephan Richter srichter@cbu.edu
Thu, 11 Apr 2002 09:40:26 -0500


>Insasmuch as I dont have the time to devote to this, I find that there are 
>some restrictions in HOW SQL methods work, as opposed to their user-level 
>syntax; in particular, the notion of collapsing all queries to a single 
>string and then passing that string to a "query" method on the DA is 
>something I'd like to deprecate in favor of:
>
>a query string constructor which takes a type and a value and returns a 
>tuple of (string, value) which the string portion is to be embedded into 
>the query string under construction, and the value is to be appended to an 
>array of values to be passed to the extended query

Can you elaborate on that? I am a little lost. Also, an example might be 
nice. :-)

>an extended query which takes a query string and an array of arguments 
>(although some DAs would prefer a dictionary of arguments -- the 
>requirement is only that the constructor and query evaluator be symmetric 
>-- both functions must be provided by the DA)

ok.

>The result from the extended query should under no circumstances be called 
>a "brain" but rather a "recordset."  Recordsets may have abilities like 
>"scrolling" but should be presumed to be a limited view (a window) into 
>the results being returned by the RDBMs.  Some of the current "brain" 
>functions (which provide synthetic columns, etc) should be busted out of 
>the recordset or appended without requiring the DA to do much work.

I agree.

>It would be nice to have a smart recordset that could tolerate write-back 
>into the recordset and compose a corresponding UPDATE into the RDBMS.

That would be nice, but I am opposed to automatic SQL generation for many 
reasons. For example, if I have PostGreSQL, I want to use *all* the 
features of it, including object features, like Inheritance of tables 
(which is really cool!)

>There should be some mechanism for invoking stored procedures ala Python 
>2.0 DB API.

Can you elaborate on this? Pointers, examples? But calling stored 
procedures via an RPC framework would be fantastic.

>There should be a better set of defined "discovery" mechanisms, e.g. find 
>out the database schemas.

Yes, but DBs are very, very different. I think the latest PostGreSQLDAs do 
a decent job finding schemas.

>There should be a better way of associating connections with stored 
>queries at runtime, such that they can be dynamically assigned by the 
>program (to facilitate per-user connections, rather than per-thread 
>connections).

Yes, but I think this functionality will come naturally when writing Zope 3 
code.

Thanks for your comments.

Regards,
Stephan

--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development & Technical Project Management