Looking for minimal SQL
David Fraser
davidf at sjsoft.com
Thu Jul 1 09:46:23 EDT 2004
Marco Aschwanden wrote:
>
> Hi
>
> I would like to develop an app that is (more or less) database
> independet. Python DB API helps when masking "parameters" of sql
> statements. The db driver cares for the correct conversion of a date,
> text, etc. This already is a big step into the right direction.
>
> The next step would be to use the least common denominator of all sql
> dialects and do without all the sql goodies that the dialects offer...
> and for this part I am wondering if anyone has a link / hint / book that
> assembled this minimum sql. I am looking for something that says for
> example:
>
> Table/DB Design: always use lowercase letters, ...
>
> Allowed sql functions: min, max, count
>
> WHERE / HAVING hints:
> - Don't use subselects
>
> The focus is actually limited to SELECT / INSERT / UPDATE / DELETE (I
> don't think that GRANT / CREATE XXX / ... statements are very portable).
>
> I am aware, that a solution created this way is not as fast and as
> elegant as an app that uses all features of a dialect, but I am really
> looking for something database independent...
>
> Thanks for any hints,
> Marco
What we have found the best approach is to start development with two
databases in mind. In that case, you have to build in a basic layer of
database-independence. Then later, adding other databases tends to be an
easy refactor.
If you like you could check out the data/dbwrapper module in jToolkit
which is an example of this approach. See jtoolkit.sourceforge.net
Regards
David
More information about the Python-list
mailing list