# General Arel, ActiveRecord Adapter question?

**URL:** <https://www.ruby-forum.com/t/general-arel-activerecord-adapter-question/195911>\
**Category:** Rails\
**Created:** [October 2, 2010, 7:15pm UTC](https://www.ruby-forum.com/t/general-arel-activerecord-adapter-question/195911 "2010-10-02T19:15:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dancinglightning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c6cbf5/32.png) [@dancinglightning](https://www.ruby-forum.com/u/dancinglightning)\
**Post date:** [October 2, 2010, 7:15pm UTC](https://www.ruby-forum.com/t/general-arel-activerecord-adapter-question/195911/1 "2010-10-02T19:15:23Z")

</div>

Hi,

I’m considering to make my database\* ActiveRecord compatible. To this  
end I have some questions, or would appreciate pointers where to ask:

- as the db is not sql, I think writing an ActiveRecord/sql adapter  
isn’t really the way to go. But then what is?
- I’ve seen an old Arel had a memory implementation in ruby. As my db  
is a memory db (in ruby/C) this may be a way, alas the code I see has  
_little_ comments. Has anyone attempted such a thing (ie a non-sql  
implementation in arel)
- is there a specific activerecord /arel mailing list ?

Thanks for any pointers (and sorry this is somewhat of-topic for  
most)

Torsten

\*warpdb is a memory object(ish) database for ruby  
[http://github.com/dancinglightning/warpdb](http://github.com/dancinglightning/warpdb)  
It works for basic things, but has yet to see a real project, so  
you’ve been warned.

---

<div class="post-metadata">

**Author:** ![dancinglightning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c6cbf5/32.png) [@dancinglightning](https://www.ruby-forum.com/u/dancinglightning)\
**Post date:** [October 2, 2010, 7:35pm UTC](https://www.ruby-forum.com/t/general-arel-activerecord-adapter-question/195911/2 "2010-10-02T19:35:17Z")

</div>

On Oct 2, 4:31 pm, dancinglightning [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I’m considering to make my database\* ActiveRecord compatible. To this  
> end I have some questions, or would appreciate pointers where to ask:

Do you really mean ActiveRecord compatible or do you just want to  
implement the ActiveModel interface ?

Fred

---

<div class="post-metadata">

**Author:** ![dancinglightning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c6cbf5/32.png) [@dancinglightning](https://www.ruby-forum.com/u/dancinglightning)\
**Post date:** [October 2, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/general-arel-activerecord-adapter-question/195911/3 "2010-10-02T21:39:56Z")

</div>

I think that your problem is not non-sql database.  
Arel is “Relational Algebra for Ruby”, so since you use non-relational  
DB, it’s not a good idea to implement any adapters for Arel.  
But, Rails 3 has changed ActiveRecord’s model architect (e.g. added  
ActiveModel), so you should try to implement some adapter for  
ActiveRecord, but not for the Arel.  
(Arel is just a query interface for ActiveRecord for relational  
databases)

On Oct 2, 8:33 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![dancinglightning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c6cbf5/32.png) [@dancinglightning](https://www.ruby-forum.com/u/dancinglightning)\
**Post date:** [October 3, 2010, 8:43am UTC](https://www.ruby-forum.com/t/general-arel-activerecord-adapter-question/195911/4 "2010-10-03T08:43:30Z")

</div>

Hi,

> Do you really mean ActiveRecord compatible or do you just want to  
> implement the ActiveModel interface ?

Yes, I’ll implement the ActiveModel interface, but what I’m asking is  
complete compatibility to an application running against say mysql.

I’m quite willing to adapt the db a bit, but I once tried writing an  
sql interpreter and ran out of fun, so tha’s what I’m trying to avoid.  
All else goes.

Torsten
