# Writing a custom DB adapter

**URL:** <https://www.ruby-forum.com/t/writing-a-custom-db-adapter/168981>\
**Category:** Rails\
**Created:** [May 28, 2009, 2:57am UTC](https://www.ruby-forum.com/t/writing-a-custom-db-adapter/168981 "2009-05-28T02:57:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kretch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/db5fbb/32.png) [@kretch](https://www.ruby-forum.com/u/kretch)\
**Post date:** [May 28, 2009, 2:57am UTC](https://www.ruby-forum.com/t/writing-a-custom-db-adapter/168981/1 "2009-05-28T02:57:09Z")

</div>

Hi There.  
Does anybody know of a resource explaining how to write a rails  
adapter for a custom (say, a funky flavour of SQL, or even non-SQL)  
database?

Thanks  
Kretch

---

<div class="post-metadata">

**Author:** ![kretch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/db5fbb/32.png) [@kretch](https://www.ruby-forum.com/u/kretch)\
**Post date:** [May 28, 2009, 3:16am UTC](https://www.ruby-forum.com/t/writing-a-custom-db-adapter/168981/2 "2009-05-28T03:16:31Z")

</div>

On Thursday 28 May 2009, kretch wrote:

> Hi There.  
> Does anybody know of a resource explaining how to write a rails  
> adapter for a custom (say, a funky flavour of SQL, or even non-SQL)  
> database?

Read the code of the existing adapters, or any specific one that comes  
close to what you’re trying to do. If you want to write your own adapter  
that’s at least as deep as you’ll have to dive into the code that’s  
already there.

Michael

–  
Michael S.  
[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://www.schuerig.de/michael/](http://www.schuerig.de/michael/)
