编写一个 ActiveRecord 适配器 [英] Writing an ActiveRecord adapter

查看:29
本文介绍了编写一个 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?

推荐答案

我认为最简单的做法是转到源.

I think the easiest thing to do is go to the source.

rails 主干具有用于 mysql、postgres 和 sqlite 的适配器,您可以将适配器作为其基础.abstract_adapter.rb 很短而且很容易实现.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆