Rails3 compatible?

16 views
Skip to first unread message

springbok

unread,
Aug 16, 2010, 4:49:14 AM8/16/10
to SQL Anywhere Web Development
Hi,

I'm about to start a new Rails3 project and just wanted to confirm if
the SQLA adapter is Rails3 compatible?

Thanks,

Etienne.

Eric Farrar

unread,
Aug 16, 2010, 11:11:39 AM8/16/10
to SQL Anywhere Web Development
Hello Etienne,

Currently, the SQLA adapter has only been fully tested on the latest
released version, Rails 2.3. Rails 3 is still in a beta , and we
looking at getting the SQLA adapter tested on the beta.

- Eric

springbok

unread,
Aug 17, 2010, 11:23:19 PM8/17/10
to SQL Anywhere Web Development
Hi Eric,

Thank you for the response.

I'm about to start work on the project and I think we will target
Rails3, the first thing I will do is test the current adapter with it
as all of our data is from an existing SQLA V11 DB.

Have you had any feedback from other users who have tried to use it
with Rails3?

Regards,

Etienne.

Eric Farrar

unread,
Aug 18, 2010, 12:50:48 PM8/18/10
to SQL Anywhere Web Development
Hi Etienne,

I have not had any other feedback from users who have tried using
Rails3. The ActiveRecord interface in Rails3 has been changed somewhat
with the introduction of ActiveRelation (http://
edgeguides.rubyonrails.org/3_0_release_notes.html), but they are still
supporting the old ActiveRecord API until Rails 3.1.

Please post if you encounter any issues.

Thanks,

- Eric

springbok

unread,
Aug 26, 2010, 11:42:12 PM8/26/10
to SQL Anywhere Web Development
Hi Eric,

I've started work on trying to get SQLA working with Rails3. The first
problem I struck was with Ruby 1.9.2 comparability, I've forked the
sqlanywhere gem and updated it to work with 1.9. Currently the code it
not backward compatible as I'm simply trying to get things working. I
did the same for the activerecord-sqlanywhere-adapter which I forked
and updated.

I was able to establish a connection using a test Rails3 app but
struck a problem when I tried to access a table within the DB, I got
this message:

SQLAnywhere is not supported by Arel

From my limited knowledge Arel (http://github.com/rails/arel) is now
used to generate the SQL statements and needs an adapter for each DB
type, currently SQLA is not supported. I can see an Arel adapter will
need to be created for SQLA but I'm a bit out of my depth as I'm
unsure how this ties in with the current SQL adapter code base, do we
use the existing code or is a completely new adapter required.

That's as far as I've got so far, let me know if I can help out in
anyway.

Regards,

Etienne.

springbok

unread,
Aug 27, 2010, 2:47:18 AM8/27/10
to SQL Anywhere Web Development
Hi Eric,

One step further...

I've added an empty Arel compiler to the activerecord-sqlanywhere-
adapter and rebuilt the gem, I'm now able to access data in my
database. So far I've only done some select statements and everything
seems to be working fine.

From what I've been able to find there are some activerecord/arel
tests that can be run that would highlight additional functionality
that needs to be added to the sqlanywhere compiler, but I'm not sure
how to do this, there does not seem to be a whole lot of documentation
about how to write a compiler.

Cheers,

Etienne.

Eric Farrar

unread,
Aug 30, 2010, 9:23:00 AM8/30/10
to SQL Anywhere Web Development
Hi Etienne,

As I understand it, Arel is supposed to act at a level above the
active-record. Arel (sort of like LINQ) is supposed to be able to
interact with all sort of data source including XML, in-memory
structures, and databases. I think in the short term at least, the
Arel libraries are using the existing active-record drivers to do the
communication with the database.

Since Arel libraries are still using the functionality of the active-
record drivers, I expect the Arel stuff should be relatively
straightforward to get working after creating an empty compiler for it
(as you have done). I will look into getting the test suite set up. In
the mean time, please feel free to post any queries that don't seem to
be working.

Thanks,

- Eric

springbok

unread,
Aug 30, 2010, 6:41:20 PM8/30/10
to SQL Anywhere Web Development
Hi Eric,

Thanks for the reply.

I've not had any issues thus far, I've been able to perform all CRUD
operations without any problems, so it's looking good.

Cheers,

Etienne.
Reply all
Reply to author
Forward
0 new messages