# ActiveRecord alternatives

**URL:** <https://www.ruby-forum.com/t/activerecord-alternatives/98341>\
**Category:** Ruby\
**Created:** [July 14, 2006, 12:02am UTC](https://www.ruby-forum.com/t/activerecord-alternatives/98341 "2006-07-14T00:02:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elriba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9f8e36/32.png) [@elriba](https://www.ruby-forum.com/u/elriba)\
**Post date:** [July 14, 2006, 12:02am UTC](https://www.ruby-forum.com/t/activerecord-alternatives/98341/1 "2006-07-14T00:02:53Z")

</div>

Hi,  
I have a database application running under sybase anywhere SQL server.  
I would like to develop modules in Ruby to access that database.

I started to look at ActiveRecord, but it seems that one requirement is  
that all tables have an identity column with a specific name. My  
database was not designed that way ☹

Are there ActiveRecord alternatives that would allow me to use my  
existing database design? Or even better, are there reviews that  
compare the different data layers available for Ruby?

Thanks,  
Edgard

---

<div class="post-metadata">

**Author:** ![elriba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9f8e36/32.png) [@elriba](https://www.ruby-forum.com/u/elriba)\
**Post date:** [July 14, 2006, 12:12am UTC](https://www.ruby-forum.com/t/activerecord-alternatives/98341/2 "2006-07-14T00:12:37Z")

</div>

On Fri, 14 Jul 2006 00:00:17 +0200, elriba [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi,  
> I have a database application running under sybase anywhere SQL server.  
> I would like to develop modules in Ruby to access that database.
> 
> I started to look at ActiveRecord, but it seems that one requirement is  
> that all tables have an identity column with a specific name. My  
> database was not designed that way ☹

I don’t think ActiveRecord is that stupid (but I’ve never tried it).  
I think there must be a way to trick it into doing that.

> Are there ActiveRecord alternatives that would allow me to use my  
> existing database design? Or even better, are there reviews that  
> compare the different data layers available for Ruby?

Yes, Og from George. You can find information on [nitroproject.org](http://nitroproject.org).  
It does what you require, but it’s hidden. The Nitro-General ML  
helps there.  
([http://rubyforge.org/mailman/listinfo/nitro-general](http://rubyforge.org/mailman/listinfo/nitro-general))

Jo

---

<div class="post-metadata">

**Author:** ![elriba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9f8e36/32.png) [@elriba](https://www.ruby-forum.com/u/elriba)\
**Post date:** [July 14, 2006, 12:37am UTC](https://www.ruby-forum.com/t/activerecord-alternatives/98341/3 "2006-07-14T00:37:39Z")

</div>

> I don’t think ActiveRecord is that stupid (but I’ve never tried it).  
> I think there must be a way to trick it into doing that.

set\_primary\_key()

> **[ActiveRecord::Base](https://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000881)**
>
> Active Record Active Record objects don't specify their attributes directly, but rather infer them from the table definition with which they're linked.

-philip

---

<div class="post-metadata">

**Author:** ![elriba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9f8e36/32.png) [@elriba](https://www.ruby-forum.com/u/elriba)\
**Post date:** [July 14, 2006, 12:57am UTC](https://www.ruby-forum.com/t/activerecord-alternatives/98341/4 "2006-07-14T00:57:33Z")

</div>

Philip H. wrote:

> > I don’t think ActiveRecord is that stupid (but I’ve never tried it).  
> > I think there must be a way to trick it into doing that.
> 
> set\_primary\_key()

You can override table names and names of all your columns. There are  
few things AR doesn’t allow (compound primary and foreign keys notably)

There is another orm [http://jutopia.tirsen.com/articles/tag/rbatis](http://jutopia.tirsen.com/articles/tag/rbatis) that  
will allow you to create much more flexible mappings.

lopex

---

<div class="post-metadata">

**Author:** ![elriba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/9f8e36/32.png) [@elriba](https://www.ruby-forum.com/u/elriba)\
**Post date:** [July 14, 2006, 1:20am UTC](https://www.ruby-forum.com/t/activerecord-alternatives/98341/5 "2006-07-14T01:20:11Z")

</div>

Hi,

> You can override table names and names of all your columns. There are  
> few things AR doesn’t allow (compound primary and foreign keys notably)

mh, ok. good to know.

> There is another orm [http://jutopia.tirsen.com/articles/tag/rbatis](http://jutopia.tirsen.com/articles/tag/rbatis) that  
> will allow you to create much more flexible mappings.

Thanks for that link, didn’t know that one yet.

Jo
