Re: [DataMapper] Creating a new adapter

35 views
Skip to first unread message

Markus Schirp

unread,
Aug 3, 2012, 8:32:26 AM8/3/12
to datam...@googlegroups.com
The best documentation are existing adapters.

An adapter that is easy to follow (IMHO) is the dm-mongo-adapter.

You can find it under https://github.com/solnic/dm-mongo-adapter.

The RDBMS adapters are a littlebit more complex to understand as they
are implemented on the abstract dm-do-adpater. But when you whant to
start an RDBMS adapter you should built it on top of dm-do-adpater.

Regards,

Markus

On 08/03/2012 02:11 PM, Greg wrote:
> Hi all
>
> I'm looking to create a new adapter for DataMapper. Is there a template
> that I can use as a starting point, or a document that I can refer to
> that explains the process?
>
> Thanks
> Greg
>
> --
> You received this message because you are subscribed to the Google
> Groups "DataMapper" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/datamapper/-/0uQwrnm8URMJ.
> To post to this group, send email to datam...@googlegroups.com.
> To unsubscribe from this group, send email to
> datamapper+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/datamapper?hl=en.

Chris Corbyn

unread,
Aug 3, 2012, 8:37:43 AM8/3/12
to datam...@googlegroups.com
I'd actually use the InMemoryAdapter as a basis to work from.  It just keeps everything in core ruby data structures, so it's easy to follow and swap out the code with your own implementation.


To see examples of doing query build etc, look at others, yep :)

Markus Schirp

unread,
Aug 3, 2012, 8:56:59 AM8/3/12
to datam...@googlegroups.com
Yeah this is a better idea as you can start pusing only small slices of
functionallity to the real db doing the rest in memory.

Like when implementing veritas adapters.
>>> <mailto:datam...@googlegroups.com>.
>>> To unsubscribe from this group, send email to
>>> datamapper+...@googlegroups.com
>>> <mailto:datamapper+...@googlegroups.com>.
>>> For more options, visit this group at
>>> http://groups.google.com/group/datamapper?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "DataMapper" group.
>> To post to this group, send email to datam...@googlegroups.com
>> <mailto:datam...@googlegroups.com>.
>> To unsubscribe from this group, send email to
>> datamapper+...@googlegroups.com
>> <mailto:datamapper+...@googlegroups.com>.

Zhi-Qiang Lei

unread,
Aug 4, 2012, 8:19:17 AM8/4/12
to datam...@googlegroups.com
Actually, the document of the AbstractAdapter has told everything you need. Just implement #create, #update, #read, #delete methods. I have an adapter for Parse if it can help.

On Aug 3, 2012, at 8:11 PM, Greg wrote:

Hi all

I'm looking to create a new adapter for DataMapper. Is there a template that I can use as a starting point, or a document that I can refer to that explains the process?

Thanks
Greg

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To view this discussion on the web visit https://groups.google.com/d/msg/datamapper/-/0uQwrnm8URMJ.
To post to this group, send email to datam...@googlegroups.com.
To unsubscribe from this group, send email to datamapper+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.


Best regards,
Zhi-Qiang Lei

Greg

unread,
Aug 8, 2012, 7:06:55 AM8/8/12
to datam...@googlegroups.com
Sorry for the late reply, I didn't receive any notifications for some reason.

Thank you all for your suggestions. I will look into the three options posted above.

Regards
Greg
Reply all
Reply to author
Forward
0 new messages