Ya, I like that way too. SQL alchemy allows you to also do it the rails way also.  The declarative stuff is for more explicit models. It is also good for when there is a db table for which you don't want to load all the columns. Granted those use cases aren't as common. So the point may be moot.... And why does apple think it can correct my grammar. Grr.<br>
<br>Rob<br><br>On Tuesday, August 9, 2011, Jacob Carlborg <<a href="mailto:doob@me.com">doob@me.com</a>> wrote:<br>> On 2011-08-09 15:07, Robert McGinley wrote:<br>>><br>>> I think a better model to follow would be SQL alchemy which allows you to test the tables or "declaratively" set columns as attributes of the model.<br>
><br>> You mean that the columns of a table should be declared as attributes of the corresponding class? Hmm, I don't know, I like that Rails way.<br>><br>>> Rob<br>>><br>>> Sent from my iPad<br>
>><br>>> On Aug 9, 2011, at 8:32 AM, Jacob Carlborg<<a href="mailto:doob@me.com">doob@me.com</a>>  wrote:<br>>><br>>>> On 2011-08-09 14:19, Jacob Carlborg wrote:<br>>>>><br>>>>> On 2011-08-09 09:30, Jonas Drewsen wrote:<br>
>>>>><br>>>>>> Just stumbled upon this db orm for c++ that uses the gcc frontend to<br>>>>>> rewrite c++ code to make classes suitable for database access.<br>>>>>><br>
>>>>> <a href="http://www.codesynthesis.com/products/odb/">http://www.codesynthesis.com/products/odb/</a> <<a href="http://www.codesynthesis.com/products/odb/">http://www.codesynthesis.com/products/odb/</a>><br>
>>>>><br>>>>>> They are using pragmas to accomplish this. I guess an equally good<br>>>>>> implementation in D would use custom attributes for this once (if) they<br>>>>>> are supported.<br>
>>>>><br>>>>>> /Jonas<br>>>>><br>>>>> I'm pretty sure you can create an ORM library like that with what we<br>>>>> already have in D today. If needed, mixins can be used like custom<br>
>>>> attributes, but it will look very ugly.<br>>>><br>>>> 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:<br>>>><br>
>>> class Person : Model {}<br>>>><br>>>> And let the super class get all info from the database, just like ActiveRecord in Ruby on Rails.<br>>>><br>>>> --<br>>>> /Jacob Carlborg<br>
><br>><br>> --<br>> /Jacob Carlborg<br>>