ActiveRecord-JDBC 0.2.3 Released
Posted by Nick Sieger Tue, 06 Mar 2007 03:58:00 GMT
ActiveRecord-JDBC version 0.2.3 has been released!
Install
Use JRuby to install the gem into your JRuby installation as follows. Currently, Rails is not a dependency of ActiveRecord-JDBC; it is assumed you’re going to have Rails installed already.
$ jruby --command gem install ActiveRecord-JDBC
Successfully installed ActiveRecord-JDBC-0.2.3
Installing ri documentation for ActiveRecord-JDBC-0.2.3...
Installing RDoc documentation for ActiveRecord-JDBC-0.2.3...
See the new RDoc documentation on Rubyforge for more information on how to use ActiveRecord-JDBC. If you’re grabbing the new JRuby 0.9.8 release, be sure you get this one as well if you plan to try out JRuby on Rails.
Changes
- Release coincides (and compatible) with JRuby 0.9.8 release
- 8 bugs fixed
- Improvements and compatibility fixes for Rails 1.2.x
Comments, questions, test cases, patches and all that are welcome over on the jruby-extras mailing list.
With ActiveRecord, I can (and do) override the ActiveRecord::ConnectionAdapters::MysqlAdapter nativedatabasetypes method, to specify additional column types (:ubigint for ‘bigint unsigned’ and :longtext for ‘longtext’).
I haven’t been able to figure out how to do the same with ActiveRecord-JDBC yet. Any thoughts?
What might cause this error? undefined method `Title’ for #
@RG: Hey, thanks for the report. Could I persuade you to post a bug report in the Rubyforge tracker? If possible please include some details of the model/database/table structure that caused the issue. Thanks!
@Ed: Have a look at the
JDBC::MySQL#modify_types
method. See if you can redefine for your purposes.Ah, got it. Added the following to the end of my environment.rb:
module JdbcSpec module MySQL def modify_types(tp) tp[:primarykey] = “bigint unsigned DEFAULT NULL autoincrement PRIMARY KEY” tp[:decimal] = { :name => “decimal” } tp[:longtext] = { :name => “longtext” } tp[:ubigint] = { :name => “bigint unsigned” } tp end end end
I just tried jruby with an app we have going against a MSSQLServer database. Got this error -
The driver encounter an error: unable to choose type from: [[“bit”, {“nullable”=>1, “numprecradix”=>nil, “localtypename”=>”bit”, ......
Looks like it is choking on a tinyint field.
Any ideas ?
Trackbacks
Use the following link to trackback from your own site:
http://blog.nicksieger.com/articles/trackback/216
Contact
Archives
Elsewhere
Pinboard (nicksieger)