On Saturday, 10 January 2015 at 20:53:47 UTC, DaveG wrote:
On Saturday, 10 January 2015 at 18:31:18 UTC, Paolo Invernizzi
wrote:
I would like to see, someday, something in D that:
- can check at compile time the syntax of SQL;
- can check at compile time the SQL query statement against
the current DB schema;
- can read the output of a DB schema dump at CT, and parse it
into what is needed for the previous points (more complicated);
One final note. You may have noticed I didn't mention the
schema syncing problem (keeping database and code in sync).
There was a time I would have said that was essential and while
it would be nice in a perfect world, I'm comfortable keeping
them in sync manually (or semi-manual with scripts). I can
generate a bunch of classes from an existing database fairly
easily and when I change a table I can manually update a class.
If I was writing SQL directly I would have to update my query,
this is really no different. Doing validation in unit tests is
perfectly acceptable to me.
I think basically we have the same feeling over the ORM topic.
Doing validation in unit tests is for sure acceptable, but my
point is that I would like CT validation of plain SQL query over
the current DB schema.... without having to use an ORM. ;-)
---
Paolo