# Views and sequences

**URL:** <https://www.ruby-forum.com/t/views-and-sequences/131225>\
**Category:** Rails\
**Created:** [March 7, 2008, 1:07am UTC](https://www.ruby-forum.com/t/views-and-sequences/131225 "2008-03-07T01:07:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parker\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/eada6e/32.png) [@Parker\_T](https://www.ruby-forum.com/u/Parker_T)\
**Post date:** [March 7, 2008, 1:07am UTC](https://www.ruby-forum.com/t/views-and-sequences/131225/1 "2008-03-07T01:07:05Z")

</div>

We’ve exposed a set of views to a nasty legacy Oracle DB that give our  
app a  
simple railsesque schema. As the DB is maintained by some hard core  
DBAs we  
let them trigger and constrain all they want (translation: they tolerate  
us). This turns out to be great except for the fact that Rails wants  
(but  
doesn’t _need_) to worry itself with sequences, forcing us to break our  
rather nice view abstraction.

I’m wondering if anyone knows how to tell Rails to just trust that the  
DB  
will assign primary keys correctly and to grab them after records are  
inserted.

Thanks,

pt.

---

<div class="post-metadata">

**Author:** ![Parker\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/eada6e/32.png) [@Parker\_T](https://www.ruby-forum.com/u/Parker_T)\
**Post date:** [March 8, 2008, 7:53pm UTC](https://www.ruby-forum.com/t/views-and-sequences/131225/2 "2008-03-08T19:53:06Z")

</div>

Have you looked at rBatis at all? It’s a decent enough port of  
iBatis. It puts you more in the driver’s seat over your interaction  
with the db. There’s a tradeoff – it’s far more capable (IMO) of  
adapting to “non-Rails” dbs but you’ve got to do more configuration.
