Forum: Ruby unit-testing sql interactions

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Fe4f9b8bc6f329a538be40e01d264b44?d=identicon&s=25 David Carlton (Guest)
on 2007-02-04 20:26
(Received via mailing list)
I'm relatively new to SQL, and I'd like to get my hands a bit dirtier.
So I'm writing a toy application (in Ruby, of course) to let me get
some more experience.  And I'm avoiding high-level SQL libraries
(e.g. ActiveRecord) because I don't think I'd learn as much about SQL
that way.

The application will use MySQL, but I don't feel comfortable writing
code without unit tests, and I'd rather not use MySQL there.  So the
way I'd imagine this working is going through some sort of
database-independent layer, which I can either hook up to MySQL or
some sort of in-memory database.


0) Is that a reasonable way to proceed?

1) What's the right database-independent layer?  ruby-odbc?

2) What should I use for the fast in-memory database for unit testing?
   Googling suggests that SQLite is a possibility, but it's not clear
   to me that it's the best choice for this task.

David Carlton
This topic is locked and can not be replied to.