Search code examples
mysqlvala

SQLHeavy for MySQL/PostgreSQL - where to start


I've seen the usage docs for SQLHeavy (I've been itching for something similar for quite some time) and it's a very cool abstraction layer.

I want the same functionality for MySQL/PostgreSQL.

  • Has the code behind SQLHeavy been created with plug-able database drivers in mind or is it 100% dedicated to SQLite?
  • If plug-ability was not taken into account, knowing the code base how clean would it be for me to attempt a port? To clarify would it need serious structure/logic changes in the code or just identify an replace every SQLite specific function and change to MySQL specific function and adapt/process arguments?

Note: I'm a PHP dev (with some C/C++/Java background) planning to work pet projects (not necessarily low involvement) in Vala.


Solution

  • It's dedicated to SQLite, and porting it isn't really feasible.

    When I created SQLHeavy I (very) briefly considered supporting multiple databases, but lots of functionality simply doesn't translate well to other databases and SQLHeavy was really designed to make accessing SQLite databases easier, not to abstract away differences between databases.

    You might want to take a look at libgda, which is a very impressive project. They distribute Vala bindings, and support multiple databases (including Postgres and MySQL).