-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection Mode: JRuby/JDBC #106
Comments
Tho I think TinyTDS is a better connection mode (which also compiles on jRuby, I am open to other connection modes. But I am not going to write them. The adapter now supports two, RubyODBC, and TinyTDS. At one time I had a connection mode for ADONET to support IronRuby. But no one in their group supported it or tested it. Basically I have the adapter written in such a way that it would be fairly straight forward to define a connection mode and a few key delegate methods that would get the results. If someone wants to work on that, I'd be happy to detail a few key points, but they should be visible to any that look. I am also very persnickety about passing tests too. So whomever takes this on, I won't accept half way / work for me code. Thoughts? |
I think that tiny_tds is a better place to put jdbc support, since more people could use it(not just raillers). What you think? |
I'm not so sure. TinyTDS is a low level connection mode. My limited understanding of JRuby and JDBC is that these are their own low level connection modes specific to that implementation. So TinyTDS and the JDBC (JTDS?) are mutually exclusive. To me this is like asking for native ADONET for IronRuby in TinyTDS as I mentioned on the adapter issue. Remember, the adapter is written in such a way that is just Ruby generating SQL that SQL Server likes. I made great care to not mix in core connection mode logic into the adapter. Hence it is very easy for us to adapt to alternate connection modes. I did this for the benefit of adding TinyTDS and ADONET and that simple architecture can be applied to native JDBC connections. |
Well, that's the approach used by oracle-enhanced. I think it's a better approach(at least when using JRuby/JVM) since it reduce the work necessary to put it up and running(just put the jtds.jar in your classpath) and free tiny_tds users from having a platform specific dependency. |
I hear what your saying, and what oracle-enhcanced is doing is similar to what I am talking about. Case in point, when the ADONET connection mode was in the adapter code base, it went thru the following steps.
An example of this can be found when I yanked the ADONET connection mode in this commit below. It has a little bit of noise, but it should be easy to see the lines specific to ADONET and the steps I mentioned above. So, I still assert that what I am talking about is right and that TinyTDS is not the place for this. The only thing your talking about is including a jtds.jar file and requiring it in step (1), configuring it in step (2), using it in steps (3) and (4). Which including is or not is moot. Sure it could be done, sure it could not be done. The point is that the steps I mentioned above are the ones to go thru and it should be easy for someone with the proper experience to leverage all the work I have done and shim in a native jtds connection mode in the framework I have in place. When do I see a pull request? |
You're right and I was wrong. it's really oracle-enhcanced that manages to rely on jdbc instead of using ruby-oci8. My bad, sorry. Btw, I will try to take a look and do some coding next week. If someone already coding something, please share here so we don't code the same thing twice :) |
Good show @plentz, if at the least, we have setup a proper place for someone to come in and contribute with a proper overview. Many of these thins are in my head and not documented well since I am the only committer to the project. Hopefully I can reach out more for help and/or garner a bigger commit base. Sadly, not that many people are used to digging deep into ActiveRecord adapter's and Arel visitors. We'll see if we can fix that. Maybe Nick Sieger would consider it or something. |
Late to the party - want to fill me in? |
Everything above should spell out the details. Hop on into #rails-sqlserver on freenode if want too. |
Sorry for the no-show @metaskills. I've endedup using jruby/activerecord-jdbc-adapter which pretty much dit the trick(and has "official" support at some level), so I think it isn't really necessary to put this much effort here. Maybe just a link to that project in the README will work well. What you think? |
No worries, I am still of the opinion that this adapter is the most robust and well tested. At its heart, it is just ruby that generates the best SQL for SQL Server and underneath are two different connection modes (c extensions) RubyODBC and TinyTDS. I'd really love for someone to write a little bit of code that would add native jtds to that list. |
it would be awesome if we can use activerecord-sqlserver-adapter in the same way we can use activerecord-oracle_enhanced-adapter. it automatically detects that it's in a jruby environment and rely to jdbc mode to connect to the database.
The text was updated successfully, but these errors were encountered: