SQL backend for GnuCash 2

Jim C. Nasby decibel at decibel.org
Fri Oct 27 12:44:24 EDT 2006


On Fri, Oct 27, 2006 at 11:51:50AM -0400, Derek Atkins wrote:
> "Jim C. Nasby" <decibel at decibel.org> writes:
> 
> > You'd be better off creating a stored-procedure-based interface and
> > having it enforce the semantics.
> 
> Except not all DBs that we want to support have stored-procedures,
> so unfortunately that's a non-starter.

Well, it depends on how you structure the code. If you put the business
logic checks near the database layer (which seems the best place to put
them), then it's a fairly simple matter of having that code pass right
through to the database for databases that support stored procedures.

Yes... it's more code, but here's something else that no one's mentioned
yet: if you're going to support multiple databases, you're going to have
a bunch of duplicated code. Even if you try and go for the lowest common
denominator (which is seldom a wise idea), there's enough
non-standardness between databases that you can't avoid duplicated code.
Just trying to get simple schema DDL to work across three different
databases can be tricky. And if you're not ready to have per-database
code, you can pretty much kiss performance goodbye, because what works
well on A will work poorly on B (witness the recent debate about GUIDs).

So, something else you should really be looking into are tools that
allow you to write your definition code once and then have it spit out
all the database-dependant code you need. I believe there's some stuff
out there now that does this, though it's also not super-hard to create
We did it at a former employer by defining things in XML and then using
XSLT to generate database code (including stored procs) for Oracle, DB2
and PostgreSQL, C interface code, documentation, and some other things.
-- 
Jim C. Nasby, Database Architect                decibel at decibel.org 
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


More information about the gnucash-devel mailing list