On 2011-08-09 14:19, Jacob Carlborg wrote:
On 2011-08-09 09:30, Jonas Drewsen wrote:
Just stumbled upon this db orm for c++ that uses the gcc frontend to
rewrite c++ code to make classes suitable for database access.

http://www.codesynthesis.com/products/odb/

They are using pragmas to accomplish this. I guess an equally good
implementation in D would use custom attributes for this once (if) they
are supported.

/Jonas

I'm pretty sure you can create an ORM library like that with what we
already have in D today. If needed, mixins can be used like custom
attributes, but it will look very ugly.

I can also add that I think D can do a lot better job than C++ with this ODB library. I think it would be possible to do this:

class Person : Model {}

And let the super class get all info from the database, just like ActiveRecord in Ruby on Rails.

--
/Jacob Carlborg

Reply via email to