Writing a new specific subproject of the ActiveRecord-JDBC adapter

Hi guys,

Considering the ActiveRecord-JDBC-Adapter project, I am facing the
challenge
to make a particular Rails application to persist against a specific
database. For it, there is currently no specific support in the adapter
(like for MySQL for instance). Using the generic JDBC approach leads to
quite a lot errors, since obviously my database is very demanding on
different things like table name length, etc. - so it has quite a lot
limitations.

So, I think that if I want to make ActiveRecord talk to my database, I
would
probably have to extend the generic AR-JDBC adapter for my DB. Is this
right, or there are other solutions to this problem ?
What kind of things can I specify for my DB, within ARJDBC adapter ? Is
there any API that I have/must conform to ?

Thanks and Kindest Regards,
Krum.

On May 12, 2011, at 1:28 AM, Krum B. wrote:

Hi guys,

Considering the ActiveRecord-JDBC-Adapter project, I am facing the challenge to
make a particular Rails application to persist against a specific database. For
it, there is currently no specific support in the adapter (like for MySQL for
instance). Using the generic JDBC approach leads to quite a lot errors, since
obviously my database is very demanding on different things like table name
length, etc. - so it has quite a lot limitations.

So, I think that if I want to make ActiveRecord talk to my database, I would
probably have to extend the generic AR-JDBC adapter for my DB. Is this right, or
there are other solutions to this problem ?
What kind of things can I specify for my DB, within ARJDBC adapter ? Is there
any API that I have/must conform to ?

Thanks and Kindest Regards,
Krum.

Sequel has excellent JDBC support for MySQL, MSSQL, Oracle, PostgreSQL,
etc…
http://sequel.rubyforge.org/

Mike

Thanks,

Seems like a great project. I didn’t know it.

Does it support MaxDB ? Or plain JDBC ? Anything else that can make
Rails/ActiveRecord talk to MaxDB ?

Kindest Regards,
Krum.

OK, I have started my first attempt to write an ActiveRecord JDBC
adapter
for MaxDB.
I followed this link:
https://github.com/nicksieger/activerecord-cachedb-adapter/

But I am getting some troubles with executing the rake db:migrate task.
The
problem is that, when an application table must be created in the data
base,
the generic version of the AR-JDBC adapter is called, but not mine.

Could you please help me in getting my specific adapter properly plugged
?

Seems that, after all, a change is needed in the AR-JDBC adapter project
as
well - to introduce my specific adapter. Is that right ?

This problem is with an application table. Previously, I had to modify
the
schema of the migrations table, so that it is ok with the SQL dialect of
MaxDB. I did it by modifying the SchemaStatements module, so that I
could
try to find all DDL-related places in the code, and override them, but
this
is quite ugly I suppose :).

Oh, and if not already clear - I am a very newbie to Ruby :slight_smile:

I am using Rails 2.3.8 and AR-JDBC adapter 1.1.1

Kindest Regards,
Krum.

It’s alright now. I made some slight changes in my discover.rb, and the
generic adapter now seems to switch to using mine without any problems.
There are currently no needs for changing the generic adapter.

Thanks for your support.

Next, we will try to make our adapter use a dynamcially created
datasource,
by means of a JNDI look up. As far as I digged into the generic adapter
sources, this is already available, by specifying the jndi: property in
database.yml

Best Regards,
Krum,

On Tue, May 31, 2011 at 2:26 PM, Krum B. [email protected]
wrote:

Seems that, after all, a change is needed in the AR-JDBC adapter project as
well - to introduce my specific adapter. Is that right ?

The intention is to not need any changes to AR-JDBC. If that’s not the
case, we’ll need to fix it. Can you give some example code to give me
an idea of what’s not working when running DDL statements?

This problem is with an application table. Previously, I had to modify the
schema of the migrations table, so that it is ok with the SQL dialect of
MaxDB. I did it by modifying the SchemaStatements module, so that I could
try to find all DDL-related places in the code, and override them, but this
is quite ugly I suppose :).

It’s probably not unheard of for situations like this. If you can
share the code somewhere, I can suggest other possible approaches.

/Nick

Oh, and if not already clear - I am a very newbie to Ruby :slight_smile:

No problem! Hope you continue to enjoy it.

/Nick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs