RejectedSoftware Forums

Sign up

Object-Relation-Mapping / Object-Document-Mapping

Hello,

I'm considering vibe.d for a new website project that I'm about to embark on. I couldn't find much information on ORM/ODM packages for D.

I did find https://github.com/buggins/hibernated and https://github.com/rikkimax/Dvorm on code.dlang.org. Are these actively maintained? What are the pros and cons of these?

Any others that I may not be aware of?

Thanks,
Saurabh

Re: Object-Relation-Mapping / Object-Document-Mapping

Am 23.05.2015 um 05:24 schrieb Saurabh Das:

Hello,

I'm considering vibe.d for a new website project that I'm about to embark on. I couldn't find much information on ORM/ODM packages for D.

I did find https://github.com/buggins/hibernated and https://github.com/rikkimax/Dvorm on code.dlang.org. Are these actively maintained? What are the pros and cons of these?

Any others that I may not be aware of?

Thanks,
Saurabh

None that I'm aware of. I had started to investigate one that would also
map to NoSQL databases, but it's just in the experimental phase and I
probably won't have time to actually finish it:
dotter

Re: Object-Relation-Mapping / Object-Document-Mapping

None that I'm aware of. I had started to investigate one that would also
map to NoSQL databases, but it's just in the experimental phase and I
probably won't have time to actually finish it:
dotter

Thanks.

In light of absence of support of ORM, I'll probably just use a non-DB solution. My data size is not very vast, so I may be able to load it all up in memory and simply use files as a backing store.

Vibe.d does need a good ORM module for bigger websites though. Everything else in Vibe.d is looking pretty good and highly useable.

Re: Object-Relation-Mapping / Object-Document-Mapping

I chanced upon this: http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/13722/

serializeToBson(myStruct) and deserialize!MyStruct(bson) are actually a major help as far as ODM is concerned. It's not fully featured, but it is useable enough! I'm going to try that.

Great stuff! :)

Re: Object-Relation-Mapping / Object-Document-Mapping

On Wed, 27 May 2015 06:57:56 GMT, Saurabh Das wrote:

I chanced upon this: http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/13722/

serializeToBson(myStruct) and deserialize!MyStruct(bson) are actually a major help as far as ODM is concerned. It's not fully featured, but it is useable enough! I'm going to try that.

Great stuff! :)

I was about to mention that. You can now also pass structs directly to the MongoDB API and they'll get serialized automatically: collection.insert(mystruct);, foreach (s; collection.find!MyStruct(...)) { ... }

The Redis driver also contains some helpers for mapping D types: https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/db/redis/types.d
But the documentation/examples are still lacking a bit.