Ian Bicking wrote: > [EMAIL PROTECTED] wrote: > >> Do all databases need ad hoc query languages? > > > A single language, no, but I do think they all need good support for ad > hoc queries. If I have to change my persistent data model to > efficiently and consistently query the objects (or tuples) in a new way, > then that model is too fragile.
One of the real conceptual challenges here is that queries in the relational model are quite different from queries of objects. In relational, you have "dumb" data that you can pick apart and recombine to form new sets of "dumb" data. So a flexible language like SQL makes sense. With objects, I find it awkward to think about queries this way. Schevo does have built-in methods that make it easy to find subsets of objects, and those methods have some simple optimizations they apply based on behind-the-scenes indexes that Schevo maintains. And Schevo automatically maintains bi-directional relationships between all parent-child relationships and exposes access to this information in a very simple and consistent API. The combination of these two features along with Python list comprehensions turns out to be extremely powerful and flexible and works great for application code. If I had to support completely ad-hoc end-user querying then I would have someone write an ODBC driver so that a Schevo database looked like a relational database to any ODBC client tool, like Access or Crystal Reports. Creating this ODBC driver is beyond my skill level as it will involve a lot of nasty C code, but conceptually I'm confident it could be done, since we can already easily export SQL from any Schevo database. -- Patrick K. O'Brien Orbtech http://www.orbtech.com Schevo http://www.schevo.org Pypersyst http://www.pypersyst.org _______________________________________________ DB-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/db-sig
