
On 01/11/2012 07:31 PM, Thorsten Ottosen wrote:
Den 11-01-2012 13:29, Roland Bock skrev:
In our company we have combination of code generator and template library which allows to do the following
TabUsers tab; tab.remove(tab.age<13 and role!="moderator");
The compiler can then ensure correct names for tables and columns, typesafety and correct syntax. This makes database programming much easier because there is much less room for stupid mistakes.
Maybe we can get 90% of it by something as simple as
class Users { BOOST_DECLARE_SQL_CLASS( "USERS" );
BOOST_SQL_VAR( int, "column_age", age ); BOOST_SQL_VAR( std::string, "column_role", role ); ... };
-Thorsten
Probably yes, but based on our current code generator I'd say it would be quite a lot of macro code, which I find hard to debug.