DB ORM

Robert McGinley mcginley.robert at gmail.com
Tue Aug 9 09:09:51 PDT 2011


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.

Rob

On Tuesday, August 9, 2011, Jacob Carlborg <doob at me.com> wrote:
> On 2011-08-09 15:07, Robert McGinley wrote:
>>
>> 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.
>
> 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.
>
>> Rob
>>
>> Sent from my iPad
>>
>> On Aug 9, 2011, at 8:32 AM, Jacob Carlborg<doob at me.com>  wrote:
>>
>>> 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/ <
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
>
>
> --
> /Jacob Carlborg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110809/389f67d2/attachment.html>


More information about the Digitalmars-d mailing list