Re: [Planner Dev] MySQL database access support



Richard Hult wrote:

Hi,

I would strongly recommend against this kind of solution, it is a
nightmare to maintain. What I would do (and what the plan has been for a
while but nobody has implemented it) is to rewrite the current database
backend to not use any psql specific code.
Since posting, I've noticed that the sql write code is actually far less pgsql specific than the sql read code -
so less re-writing would be needed - I think.

There was also a suggestion in the list that we should standardise all
database access to SQL95 -- essentially using the "lowest common
denominator" - but the postgresql code using cursors works so why change
it?

The current code is kind of ugly and buggy so it needs to be cleaned up or
rewritten anyway. And by adding mysql suppport we only get psql and mysql.
By using a common subset we get potentially support for a lot of other
providers through libgda.
What I forgot to put in the previous post was that the mysql queries are as generic as possible -- the data format conversion is the only "mysql" specific element (for expediancy at the moment and wasn't intended to stay). The idea was that the "mysql" code would be standard enough to connect to any database source that gda suppored. The db selection code in planner would still need to pass the database type to libplanner so that libplanner can select the correct gda "provider". (The db selection dialog may be able to dynamically build a list of installed providers but I've not been looking at the gui side - perhaps the gui can code the provider string into the uri somehow, so libplanner simply "wont know" but will just try to connect to the specified provider?).

If you're happy to lose the postgres-specific cursor queries then that makes it a lot simpler and definatley much more maintainable & readable. My approach was based on leaving alone the code that already worked (with pgsql).

I'll take the pgsql cursor queries out and this removes the need for the ugly branches in mrp-sql.c, but for the moment I dont see a way round needing the gui to somehow pass the database type to libplanner so that the correct gda provider is used. I'll also check the bugzilla and see if there are db specific bugs that I can look at at the same time.

jon



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]