midas / usesguid_migrations

Makes your migrations work with usesguid plugin without explicitly defining the primary key id in migrations.
MIT License
5 stars 2 forks source link

jdbc adapter? #5

Open mingus opened 13 years ago

mingus commented 13 years ago

How difficult would it be to throw together a jdbc adapter? I'm currently stuck with doing a rails3 app in JRuby+JDBC (which will talk to MySQL, though possibly later PostgreSQL). I might give it a shot regarding hacking my own, though I'm not at all familiar with the innards of jdbc.

midas commented 13 years ago

Not exactly sure. I am trying to forget Java. I do know that you just have to be able to submit raw SQL to the DB. So I would assume not that hard. You could definitely follow the pattern I have laid out.

In fact, I am not even sure that you need a JDBC driver per se. Seems like JRuby might take care of that translation. Am I wrong?

If you get it working and speced I would be willing to merge it. Just fork the project and code away.

mingus commented 13 years ago

I'm getting an error like:

undefined method 'usesguid_create_table' for #ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1adedc2

If my understanding is correct, given that my Gemfile uses 'activerecord-jdbcmysql-adapter' and 'jdbc-mysql', it's going to look for a jdbc version in 'usesguid_migrations/active_record_extensions/connection_adapters/'... yes? Since I'm not talking to MySQL (or SQlite) "directly" then a jdbc version of the adapter is needed for the ActiveRecordExtensions (I'm guessing). If I were to want to use the plugin with raw PostgreSQL wouldn't there need to be a Postgres version of the adapter as well?

midas commented 13 years ago

That error supports your conclusions.