Looking for minimal SQL
Marco Aschwanden
PPNTWIMBXFFC at spammotel.com
Thu Jul 1 06:42:28 EDT 2004
> What kind of application are you developing ?
I am developing nothing right now. I still am evaluating... eventually a
simple CRM (Customer Relationship Management). I might start doing
something next year, but my brain started to create a framework.
There are several reasons why I would like to stay "db" independent: For
one I would like to run the "same" application over some rpc-server (which
would have a powerful db) or as a standalone application with a "simple"
db behind (which will synchronized from time to time *plan*plan*). I have
already implemented a "simple" framework that allows me to reuse the same
code be it as a multi-tier app be it as a standalone app. A database
switch in the future is possible... hence... etc. etc.
-> Python offers openess when it comes to os platforms
-> db api offers a certain openness when it comes to dealing and
parameterizing sql-stmts ... I want to stick to a minimal sql-language set
to achieve real db openness
I am aware that programming "sql-neutral" is not the most efficient, the
easiest way to go. For example: If Sub-Selects are not portable than I
would split up the queries and glue them together with Python. If for
example one looks for the oldest customer:
With sub-selects you may write:
SELECT * FROM customer WHERE age = (SELECT max(age) FROM customer)
Without sub-selects I would have to write two seperate statements:
SELECT max(age) FROM customer --> take the "age" out of this query
"SELECT * FROM customer WHERE age = ?", (age)
This might not be the fastest solution but I would like to try!
Hope this answers your question,
Marco
More information about the Python-list
mailing list