datamapper / do

DataObjects
147 stars 73 forks source link

Add Progress OpenEdge database adapter #34

Closed abevoelker closed 12 years ago

abevoelker commented 12 years ago

I would like to add support to DataObjects for a relational database called OpenEdge. I can get all the usual DO tests to pass except two minor ones that I've documented in the README that are limitations of either the database or a flaw in the JDBC driver.

It's a database/language that I despise, yet I think that DataMapper could really breathe some life into it with its awesome support for legacy schemas. I'm starting to work on the next step, a dm-openedge-adapter, to get there.

Please let me know if there is anything else I need to do to get this merged. Thanks!

myabc commented 12 years ago

@abevoelker Thanks for the PR. I appreciate the work put in to this. Indeed, I was hoping more people would grasp the initiative and provided drivers for their DB of choice.

The only problem (and one we've already encountered with Oracle) is providing a way to support this in a CI setup and/or for other developers working on DO to test your work. We will want to evolve our API over time, and as such we need to ensure we don't cause regressions. Are there free / lite editions of OpenEdge we can test against?

abevoelker commented 12 years ago

@myabc Unfortunately OpenEdge is probably in a similar situation to Oracle here. Progress does provide a free testing version, but you have to sign up for an account first, and then the only version I've been able to get to install successfully is the Windows version (I've had to do all my testing by running it on a VM). The other version is for old-timey Unix versions like HP-UX, although some people have been able to get it to run on RedHat / CentOS (I couldn't after about an hour so I gave up).

So I'm not sure what a good solution would be. If I had the $, I would provide 24/7 access to a database server to be used for DO CI testing (unfortunately I don't as my wife is in medical school). Did the Oracle driver come up with a clever solution that I could perhaps copy?

Also, deepest apologies but I temporarily screwed up the jdbc-openedge gem on Rubygems so this isn't OK to pull yet anyway. It's my first RubyGems-published gem, and I was under the impression from reading the yank documentation that if I yanked all versions of the gem, that it would disappear and be able to be restarted from scratch. Apparently this is not the case, so I'm waiting on a support ticket to reset it.

myabc commented 12 years ago

@abevoelker You're correct in stating that Oracle isn't tested by Travis. I did have test environment setup locally for Oracle though. I don't have a testing environment for OpenEdge.

Oracle provides Database Express (Oracle XE), which we would be able to use if we still maintained our own CI server – and I imagine we might be able to get support for it from the Travis CI guys.

abevoelker commented 12 years ago

@myabc Hmm, I guess the closest thing in OpenEdge land is the free evaluation version. I am pretty sure there is no explicit "Lite" or "Express" version outside of the evaluation version, but I will ask on the company's forum to find out for sure.

Would it be acceptable if I got a VM image of CentOS pre-prepared with OpenEdge on it? I'm not too familiar with how Travis works, but it looks like they use Ubuntu VM images. I could try to get OpenEdge working under Ubuntu, but can't guarantee if it's feasible. If I got an Ubuntu image working with OpenEdge, does that mean that it would be possible for Travis to use this image?

abevoelker commented 12 years ago

@myabc Sorry to keep bombarding you - I think I see how Travis does it by looking at the Postgres install Chef recipe. It would probably be a bit of work to write a recipe for OpenEdge, as there is no apt-get type package and not really even a tarball that isn't behind a login screen that can be wget'ed. I posted on Progress's forums in hopes of making such a fetch easier.

If a local testing environment similar to how Oracle is working is acceptable, could I just send you a VM image for the time being?

abevoelker commented 12 years ago

Hi @myabc, I created a CentOS 5.8 VM with the freely available OpenEdge 11.1 evaluation kit using VirtualBox. I have a VirtualBox snapshot called "test db running on port 13370" that has the database already running, immediately ready for running specs against. I initially tried exporting the VM using VirtualBox's "export appliance" option, which creates a .ovf file, but that doesn't preserve the snapshots. The recommended advice is to simply share the entire directory structure, so I compressed this structure into a [.tar.gz file](http://abevoelker.com/CentOS 5.8 32-bit.tar.gz) for this purpose (it's 3.0GB). With the server running, the way to run specs from the client is:

  1. Put the OpenEdge 11.1 JDBC driver .jar somewhere in Java $CLASSPATH
  2. gem install jdbc-openedge -v11.1
  3. Run the do_openedge tests - e.g. DO_OPENEDGE_HOST=192.168.1.100 rake spec

I've run all specs on Ubuntu 11.10 64-bit with JRuby 1.6.7 and they all pass. Would this be sufficient to get do_openedge merged into do? Thanks!

myabc commented 12 years ago

Ok cool! I will try to test this out.

Sent from my iPhone

On 24.07.2012, at 13:02, Abe Voelkerreply@reply.github.com wrote:

Hi @myabc, I created a CentOS 5.8 VM with the freely available OpenEdge 11.1 evaluation kit using VirtualBox. I have a VirtualBox snapshot called "test db running on port 13370" that has the database already running, immediately ready for running specs against. I initially tried exporting the VM using VirtualBox's "export appliance" option, which creates a .ovf file, but that doesn't preserve the snapshots. The recommended advice is to simply share the entire directory structure, so I compressed this structure into a [.tar.gz file](http://abevoelker.com/CentOS 5.8 32-bit.tar.gz) for this purpose (it's 3.0GB). With the server running, the way to run specs from the client is:

  1. Put the OpenEdge 11.1 JDBC driver .jar somewhere in Java $CLASSPATH
  2. gem install jdbc-openedge -v11.1
  3. Run the do_openedge tests - e.g. DO_OPENEDGE_HOST=192.168.1.100 rake spec

I've run all specs on Ubuntu 11.10 64-bit with JRuby 1.6.7 and they all pass. Would this be sufficient to get do_openedge merged into do? Thanks!


Reply to this email directly or view it on GitHub: https://github.com/datamapper/do/pull/34#issuecomment-7204058

abevoelker commented 12 years ago

@myabc The whole snapshot thing is probably over-complicated, so I also created a [regular bootable VM](http://abevoelker.com/CentOS 5.8 32-bit Clone.ova) with VirtualBox that is 1.6GB. You should just be able to do "Import Appliance" from VirtualBox to load it.

After start up, log in as test user (password test) and these instructions will start the database (substitute 13370 with whatever port number is preferred):

proenv
sql_env
proserve test -S 13370

The root user password is password if that is needed.

travisbot commented 12 years ago

This pull request fails (merged 6a8083ea into bcfbdf48).

abevoelker commented 12 years ago

Piss off travisbot, I never touched the MySQL stuff :P

myabc commented 12 years ago

@abevoelker I won't have time to test this for a few more days, but I haven't forgotten about your patch.

abevoelker commented 12 years ago

@myabc No worries, I'm not in any rush at all for this to be reviewed. Have fun @ Eurucamp! :)

abevoelker commented 12 years ago

Anything I can do to help get this merged?

dbussink commented 12 years ago

@myabc Is there anything holding this back? I want to get a release out and would love to merge this in before then.

abevoelker commented 12 years ago

Thank you gentlemen! Next I'll clean up my dm-openedge-adapter.