编写一个ActiveRecord适配器 [英] Writing an ActiveRecord adapter
问题描述
我想我自己写的的ActiveRecord适配器为的因为没有HBase的数据库当前存在。不过,我一直在寻找了一段时间在网上,找不到关于如何编写一个ActiveRecord适配器的任何好的资源。你会如何去这样做,还是有可以推荐的任何链接?
I'd like to write my own ActiveRecord adapter for the HBase database since none currently exist. However, I've been searching for a while online and can't find any good resources on how to write an ActiveRecord adapter. How would you go about doing this, or are there any links you can recommend?
推荐答案
我觉得做最简单的事情是<一个href="http://github.com/rails/rails/tree/1c11437a32a973fa9b521c32caa7256f9772acd7/activerecord/lib/active%5Frecord/connection%5Fadapters">go到源。
I think the easiest thing to do is go to the source.
在轨道干线有适配器为MySQL,Postgres的和SQLite,你可以将你的基础适配器上。 abstract_adapter.rb
是pretty的短,和相当简单的实现。
The rails trunk has adapters for mysql, postgres and sqlite, which you could base your adapter on. abstract_adapter.rb
is pretty short and fairly straight forward to implement.
这篇关于编写一个ActiveRecord适配器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!