BetterDatabaseDrivers
Better and simpler infrastructure for database drivers
This is for the moment just a brainstorming page. This is too unformal at the time being to be converted to a real "issue" in issuezilla or a specification.
Idea 1: have a "drivers loader"
Summary: currently, most database drivers are divided in two libraries:
- a small part that verifies that the conditions are met to load a given driver - a big part that will in turn dl'open the needed libraries and do the real job
The idea would be to merge all the small "loader" parts
Pros: efficiency, reduce number of libraries
Cons: against modularity
Idea 2: have "evaluation trees" in addition to current SQL syntactic tree
Summary: currently, the drivers that have to analyse the SQL syntax use the SQL parser, which does all the dirty work of checking grammar and tokenizing, but they are on their own when it comes to running the request. Perharps the runtime in-memory trees for selections and sorting of the kab driver could be reused.
Pros: simplify code for drivers like the evolution driver
Cons: uncertain feasability, because the way that you run a request might depend to some extent upon the underlying database.
Idea 3: have a "generic driver"
Summary: currently, there's a lot of drivers which duplicate a lot of code. It could be done in several steps, starting with a basic infrastructure for the simplest drivers which mainly differ in the code to access the concrete table data, and ending with drivers that are different in many aspects.
Pros : remove code redundancy
Cons : major rewrite
Idea 4: have a "drivers inheritance tree"
Summary: basically the same as idea 2, but with drivers inheriting one from the other, rathing than inventing new shared UNO interfaces. The inheritance tree could look as follows:
database driver
! +--- SQL driver ---+--- MySQL ! +--- PostGreSQL ! +--- HSQLDB ! +--- Adabas ! +--- ODBC ! +--- JDBC ! +--- ado ! +--- API driver ---+--- File driver ---+--- Flat ! +--- Calc ! +--- dBase ! +--- Mozilla +--- Thunderbird +--- Evolution +--- KDE
Pros: ease of writing new drivers
Cons: Major rewrite too