# Sequel vs. RDBI vs. DBI

**URL:** <https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055>\
**Category:** Ruby\
**Created:** [March 2, 2013, 2:45am UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055 "2013-03-02T02:45:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jim-harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jim-harris](https://www.ruby-forum.com/u/jim-harris)\
**Post date:** [March 2, 2013, 2:45am UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055/1 "2013-03-02T02:45:56Z")

</div>

So it looks like RDBI hasn’t been touched in a while and DBI  
appears dormant, so I’ve been looking at Sequel . I like what  
I’ve seen so far and I’m just wondering if this would be  
considered “the way to do database programming in ruby”  
(if there is one) ?

I moved from DBI to RDBI a while back and would like to  
stick with something that’ll be around and supported  
along with the language.

Thanks,

–  
Jim H.  
IT Security Engineer  
UF Information Technology  
Office of Information Security and Compliance

---

<div class="post-metadata">

**Author:** ![jim-harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jim-harris](https://www.ruby-forum.com/u/jim-harris)\
**Post date:** [March 3, 2013, 2:02pm UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055/2 "2013-03-03T14:02:14Z")

</div>

Jim H. wrote in post #1099800:

> So it looks like RDBI hasn’t been touched in a while and DBI  
> appears dormant, so I’ve been looking at Sequel . I like what  
> I’ve seen so far and I’m just wondering if this would be  
> considered “the way to do database programming in ruby”  
> (if there is one) ?
> 
> I moved from DBI to RDBI a while back and would like to  
> stick with something that’ll be around and supported  
> along with the language.
> 
> Thanks,
> 
> –  
> Jim H.  
> IT Security Engineer  
> UF Information Technology  
> Office of Information Security and Compliance

I’m not prepared to state that Sequel is THE way to do database  
programming in Ruby". But it’s a solid choice and is continuously  
updated. I use it daily in a variety of environments: SQL Server or  
SQLite; desktop or server; MRI or JRuby.

David

---

<div class="post-metadata">

**Author:** ![jim-harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jim-harris](https://www.ruby-forum.com/u/jim-harris)\
**Post date:** [March 3, 2013, 5:20pm UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055/3 "2013-03-03T17:20:01Z")

</div>

I would really suggest using Sequel before (or instead of) ActiveRecord.  
Its smaller, lighter, and (if you’re used to sql) closer to the bone.

I found I had _serious_ problems trying to understand Sequel’s syntax  
after using ActiveRecord, and the lack of #find\* helpers like  
ActiveRecord  
has threw me for a loop.

As I started digging deeper into Sequel, and started throwing out  
ActiveRecord it started getting a bit easier, but I do have to say that  
working with Sequel was far harder than it had to be because of hitting  
ActiveRecord first. I got spoiled with the easier syntax and fooled into  
thinking it was the ‘better’ of the two. I got that totally wrong.

---

<div class="post-metadata">

**Author:** ![jim-harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jim-harris](https://www.ruby-forum.com/u/jim-harris)\
**Post date:** [October 19, 2013, 4:43am UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055/4 "2013-10-19T04:43:41Z")

</div>

I really like Sequel compared to A/R, but just today I’ve hit a problem  
that as near as I can tell is a problem with Sequel: It fails when  
attempting to use transactions with MS-SQL Server (which sadly, is the  
database I have to use).

I can use ‘isql’ from the Linux command line and do transactions with  
SQL-Server just fine. I can use Sequel with transactions against  
PostgreSQL, but Sequel and transactions against SQL-Server… no-uh-uh…

I’m very bummed about this because I really liked everything else I’ve  
seen, but this is likely a deal-breaker for me.

---

<div class="post-metadata">

**Author:** ![jim-harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jim-harris](https://www.ruby-forum.com/u/jim-harris)\
**Post date:** [March 4, 2013, 4:32pm UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055/5 "2013-03-04T16:32:01Z")

</div>

+1 for Sequel. Use it in production with several apps and have  
absolutely no complaints.

Bryan

---

<div class="post-metadata">

**Author:** ![jim-harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jim-harris](https://www.ruby-forum.com/u/jim-harris)\
**Post date:** [October 23, 2013, 5:13pm UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055/6 "2013-10-23T17:13:45Z")

</div>

Joe Meirow wrote in post #1124887:

> I really like Sequel compared to A/R, but just today I’ve hit a problem  
> that as near as I can tell is a problem with Sequel: It fails when  
> attempting to use transactions with MS-SQL Server (which sadly, is the  
> database I have to use).
> 
> I can use ‘isql’ from the Linux command line and do transactions with  
> SQL-Server just fine. I can use Sequel with transactions against  
> PostgreSQL, but Sequel and transactions against SQL-Server… no-uh-uh…
> 
> I’m very bummed about this because I really liked everything else I’ve  
> seen, but this is likely a deal-breaker for me.

Sequel fully supports transactions on most adapters that connect to  
Microsoft SQL Server (tinytds, jdbc/sqlserver, jdbc/jtds, odbc). I  
think the only adapter that doesn’t support them is ado with the default  
provider, since that doesn’t provide a consistent connection object (a  
problem with win32ole, not with Sequel).

Thanks,  
Jeremy

---

<div class="post-metadata">

**Author:** ![jim-harris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/278dde/32.png) [@jim-harris](https://www.ruby-forum.com/u/jim-harris)\
**Post date:** [October 19, 2013, 5:03am UTC](https://www.ruby-forum.com/t/sequel-vs-rdbi-vs-dbi/227055/7 "2013-10-19T05:03:48Z")

</div>

A happy retraction. I’ve found the source of my problem and now can “+1”  
Sequel.

(FWIW, I was not setting the :db\_type to ‘mssql’ in the connection)
