From: Jared R. <lis...@nc...> - 2006-10-08 21:34:37
|
Hi all, I've just released an open source Ruby wrapper for Hypersonic. I had a client who wanted to use Hypersonic from Rails and they wanted it open sourced. This driver was the first step. The Rails part would've used this part, but the project isn't being pursued, so the Rails part didn't get finished. If you have any problems, please pass them on and I'll try to get them fixed in a timely manner. I do have a newer version of the driver with more code to support ActiveRecord/Rails requests, but I wanted to release the minimal version for now. When I have time I'll try to get the AR code support into the next release. This is my first Hypersonic project, so the code hasn't been tested beyond the bundled tests and examples. Feel free to offer improvements. :) http://rubyforge.org/projects/hypersonic/ I'll paste the readme at the end of this message. btw, the downloadable gem wont' be available for an hour or two due to the project's infrastructure. Jared http://jaredrichardson.net ---------------------------------------- README.TXT -------------------------------------- This is a driver (or bridge) to allow your Ruby code to use the Hypersonic database. There are two things you need to do before you can use this driver. First, you must have the Yet Another Java Bridge installed. http:// www.cmt.phys.kyushu-u.ac.jp/~M.Sakurai/cgi-bin/fw/wiki.cgi?page=YAJB Second, you must have hsqldb.jar in your classpath. If you can run "rake test", then you're environment is probably fine. Just be sure that the user account you'll be running the driver under also has their classpath set up properly. To build and install, type "rake gem", then "gem install hypersonic-1.0.gem" or "sudo gem install hypersonic-1.0.gem". You may need to insert a newer version number than 1.0 You can extract examples from the test folder. The Test_hypersonic.rb file will show you exactly how to use the driver, but here's a short example as well. It's extracted from the test folder. @temp_table_name = "TEMP_TABLE_FOR_THESE_TESTS" @h = Hypersonic.new @h.connect("jdbc:hsqldb:file:testdb2", "sa", "") @h.execute_update("DROP TABLE #{@temp_table_name} IF EXISTS") @h.execute_update("CREATE TABLE #{@temp_table_name} (c1 INTEGER, c2 VARCHAR)") @h.execute_update("INSERT INTO #{@temp_table_name}(c1, c2) VALUES (32, 'howdy')") rs = @h.execute_query("SELECT * FROM #{@temp_table_name}") rs = @h.execute_query("SELECT COUNT(*) FROM #{@temp_table_name}") Please let me know if you have problems running the driver. Jared http://jaredrichardson.net |