> On Thursday, July 17, 2014 6:51:37 AM UTC-7, > [email protected] wrote: >> >> Hi, I started migrating the OpenEdge adapter to a separate plugin and I >> have a couple of questions. >> >> From a plugin I can register the JDBC subadapter by modifying >> `Sequel::JDBC::DATABASE_SETUP`, but how could I go about registering the >> shared adapter for ODBC (there's a case statement and init code in >> Sequel::ODBC::Database#adapter_initialize)? >> > > If you are on ruby 2.0+, then overriding the method via Module#prepend is > the way to go.
Unfortunately it looks like JRuby doesn't understand that yet. I might just leave ODBC support out for now, I've no way of testing it anyway. > Note that I plan on making changes soon that will allow subadapters to be > picked up automatically even if external, similar to how regular adapters > are picked up. This should make things easier on you and other external > adapter writers. Cool, yeah that would be very useful :) >> One another thing I mentioned in the original PR is also that the JDBC >> subadapter type is :datadirect here as that's the first part of the >> connection URI, but datadirect itself has other possible sub-types (e.g. >> jdbc:datadirect:openedge:..., jdbc:datadirect:informix:..., etc.). What >> would be the best way to handle that? Or do you think it shouldn't >> matter? >> > > Sequel will just try to load the jdbc/datadirect subadapter in that case, > and you'd be responsible for setting things up after that, probably by > looking at the next protocol after jdbc:datadirect. Yeah, that's what I thought. The problem is that my plugin will only know how to handle openedge, I'd imagine there would be a separate one for informix, etc. I think I can just verify that the protocol is OK for now, and deal with other protocols when need arises. -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
