[Planner Dev] MySQL database access support
- From: Jon Wilkins <jon wilkins winskil co uk>
- To: Planner Project Manager - Development List <planner-dev lists imendio com>
- Subject: [Planner Dev] MySQL database access support
- Date: Tue, 20 Dec 2005 01:08:17 +0000
Hi All,
I've spent some time over the past couple of days getting to grips with
the gda/postgresql bits of libplanner.
I've got planner opening a small project from mysql whilst retaining
support for postgresql (including the original CURSOR-based queries).
The planner gui current builds a URI of
sql://user:password(at)host#database&project_id
as a result of entry in the Open From Database dialog.
This uri is passed through to libplanner which uses the "sql" prefix to
call code to open via the database storage module instead of file.
By getting the planner gui to generate "mysql://" or "pgsql://" uri's
instead, I've enabled libplanner to select the correct gda database
provider. The same uri prefix is used in mrp-sql.c (the source that
actually does the data access) to select between two different sets of
sql statements - one for postgresql and one for mysql.
The code is pretty messy at the moment with lots of debugging stuff &
some horrid string handling & switches that I need to clean up before
getting others to give it a go - and I've yet to tackle saving-to-mysql
but I think the changes will be along the same lines as those for
loading from mysql.
As database support was discussed on the list a couple of weeks ago with
talk of updating the "Open From Database" dialog I thought I'd post
something on here.
And a question to Kurt/Richard.... Do you have any problems with using
the prefix/protocol on the uri to denote the database type? In my code
I've left the current "sql" as a pseudonym for "pgsql" so that the
planner/libplanner interface is maintained.
All being well, I'd hope to get this cleaned up over the next couple of
weeks.
A merry festive time to you all as well!
jon
--
// get the picture! http://jonwilkins.smugmug.com //
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]