SQL Abstraction

SQL abstraction is hard it seems. Trying to insert an empty record in SQLite should look like this:


In SQL::Abstract and SQL::Maker, it does not work:

INSERT INTO "authors" () VALUES () # syntax error

The only module that seems to get things right is vti's ObjectDB2, which is in a very early stage of development and not on CPAN so far.

1 Comment

The problem in itself is not that complicated. It is the infrastructure required in order to store all the itsy bitsy pieces of information needed to make a correct decision on what to emit. This is why you currently do not see this solved except for frameworks (i.e. the forementioned odb2, DBIx::Class, ROse::DB, etc)

There is slow progressing work on abstracting this, but for the time being you need to use something more advanced than a mere sql generator to be able to reap the benefits of "just works". This is not that much the fault of lazy programmers, it's more of: Holy flying fuck SQL flavors are so fucked up levitating shit batman!

Leaving you some POD for further ponderage: DBIx::Class::SQLMaker::LimitDialects/SQL-LIMIT-DIALECTS. Oh and note how half of them are not usable without extra metadata.


Leave a comment

About Forward Ever

user-pic I blog about Perl.