[Monetdb-developers] [Monetdb-checkins] clients/src/ruby activerecord-monetdb-adapter-0.1.gem, , NONE, 1.1 activerecord-monetdb-adapter-0.1.gemspec, , NONE, 1.1 Changelog, , 1.2, 1.3 README, , 1.3, 1.4 TODO, , 1.2, 1.3 ruby-monetdb-sql-0.1.gem, , 1.2, 1.3

Stefan Manegold Stefan.Manegold at cwi.nl
Wed May 20 13:35:37 CEST 2009


On Wed, May 20, 2009 at 11:17:14AM +0000, Gabriele Modena wrote:
> Update of /cvsroot/monetdb/clients/src/ruby
> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30426
> 
> Modified Files:
> 	Changelog README TODO ruby-monetdb-sql-0.1.gem 
> Added Files:
> 	activerecord-monetdb-adapter-0.1.gem 
> 	activerecord-monetdb-adapter-0.1.gemspec 
> Log Message:
> Fixed bugs that prevented the correct working of activerecords' migration; The activerecord connector now supports insertion, update and alter table operations; Type casting is working in activerecord; Added a rubygem and rakefile for activerecord-monetdb-adapter; Added a new usage example for activerecord to the README file; Added an example directory to the cvs tree; The driver now correctly works with merovingian.
  ^^^^^^^^^^

Shouldn't this checkin then have gone to the May2009 release branch?

See `man cvs` and/or pages 8 - 16 of
http://homepages.cwi.nl/~manegold/Presentations/MonetDBdevTTT.pdf
for information about how to use CVS branches in genral and/or with MonetDB
in particular. Don't hesitate to ask if you have questions.

Please check with Sjoerd, whether a(n execptional!) back-port is desired;
if so, see the above references (or ask) how to do this using CVS commands,
only.
If required, I can help.

Stefan

> 
> U Changelog
> Index: Changelog
> ===================================================================
> RCS file: /cvsroot/monetdb/clients/src/ruby/Changelog,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -d -r1.2 -r1.3
> --- Changelog	9 May 2009 14:49:30 -0000	1.2
> +++ Changelog	20 May 2009 11:17:12 -0000	1.3
> @@ -1,3 +1,13 @@
> +* Mon 18 May 2009 15:22:31 CEST
> +Fixed bugs that prevented the correct working of activerecords' migration;
> +The activerecord connector now supports insertion, update and alter table operations;
> +Type casting is working in activerecord;
> +Added a rubygem and rakefile for activerecord-monetdb-adapter;
> +Added a new usage example for activerecord to the README file;
> +Added an example directory to the cvs tree;
> +The driver now correctly works with merovingian.
> +
> +
>  * Sat  9 May 2009 15:58:36 CEST
>  Fixed bugs with the query processing in the standalone driver;
>  Added INSERT and UPDATE methods in the activerecord connector.
> 
> --- NEW FILE: activerecord-monetdb-adapter-0.1.gemspec ---
> Gem::Specification.new do |s|
>    s.required_ruby_version = '>= 1.8.0'
>    s.name = %q{activerecord-monetdb-adapter}
>    s.version = "0.1"
>    s.date = %q{2009-05-18}
>    s.authors = ["G Modena"]
>    s.email = %q{gm at cwi.nl}
>    s.summary = %q{ActiveRecord Connector for MonetDB}
>    s.homepage = %q{http://monetdb.cwi.nl/}
>    s.description = %q{ActiveRecord Connector for MonetDB built on top of the pure Ruby database driver}
>    s.files = [ "adapter/active_record/connection_adapters/monetdb_adapter.rb" ]
>    s.has_rdoc = true
>    s.require_path = './lib'
>    s.add_dependency(%q<activerecord>, [">= 2.3.2"])
>    s.add_dependency(%q<ruby-monetdb-sql>, [">= 0.1"])
> end
> 
> U ruby-monetdb-sql-0.1.gem
> Index: ruby-monetdb-sql-0.1.gem
> ===================================================================
> RCS file: /cvsroot/monetdb/clients/src/ruby/ruby-monetdb-sql-0.1.gem,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -d -r1.2 -r1.3
> Binary files /tmp/cvs9arhWX and /tmp/cvsfjZs3J differ
> 
> --- NEW FILE: activerecord-monetdb-adapter-0.1.gem ---
> (This appears to be a binary file; contents omitted.)
> 
> U README
> Index: README
> ===================================================================
> RCS file: /cvsroot/monetdb/clients/src/ruby/README,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -d -r1.3 -r1.4
> --- README	7 May 2009 15:06:41 -0000	1.3
> +++ README	20 May 2009 11:17:12 -0000	1.4
> @@ -2,7 +2,6 @@
>  This directory contains the a ruby interface to monetdb5 
>  written in pure ruby.
>  
> -
>  lib/MonetDB.rb
>  lib/MonetDBConnection.rb
>  lib/MonetDBStatements.rb
> @@ -16,54 +15,8 @@
>  
>  doc/: rubydoc in HTML format
>  
> -== ActiveRecord adapter ==
> -Active Record connects business objects and database tables to create a persistable domain model where logic and data are presented in one wrapping. It‘s an implementation of the object-relational mapping (ORM) pattern.
> -
> -Required files:
> -adapter/lib/active_record/monetdb_adapter.rb
> -
> -At the moment connection and SELECT queries are supported.
> -
> -Usage example follows:
> -
> -
> -require 'active_record'  
> -
> -ActiveRecord::Base.establish_connection(  
> -        :adapter => "monetdb",  
> -        :host => "localhost",  
> -        :database => "demo"  
> -)
> -
> -# map the tables schema to a class
> -class Tables < ActiveRecord::Base
> -end
> -
> -# return the first result of the query SELECT * from tables
> -puts Tables.find(:first)
> -  
> -
> -
> -
> -== Rubygem ==
> -
> -The standalone ruby driver can be distributed as a ruby gem.
> -A gem file is already available; however, it can be generated 
> -starting from the ruby-monetdb-sql-0.1.gemspec file:
> -
> -$ gem build ruby-monetdb-sql-0.1.gemspec
> -
> -To install the file run the command:
> -
> -$ gem install ruby-monetdb-sql-0.1.gem
> -
> -Documentation in ri and html format will be generated and installed as well
> -
>  == Usage ==
> -To use the driver import the 'MonetDB' class and 'rubygems' (in case you installed it using gems).
> -
> -
> -* Processing Statements that Return a Result Set
> +To use the standalone driver import the 'MonetDB' class and 'rubygems' (in case you installed it using gems).
>  
>  A typical sequence of events is as follows:
>  Invoke query using the database handle to send the statement to the server and get back a result set object.
> @@ -104,3 +57,85 @@
>  db.close
>  
>  See lib/demo.rb and the MonetDBDatar class documentation for more examples.
> +
> +
> +
> +== ActiveRecord connector adapter ==
> +Active Record connects business objects and database tables to create a persistable domain model where logic and data are presented in one wrapping. It‘s an implementation of the object-relational mapping (ORM) pattern.
> +
> +Required files:
> +
> +adapter/lib/active_record/monetdb_adapter.rb
> +
> +Usage example follows:
> +require 'active_record'
> +
> +ActiveRecord::Base.logger = Logger.new(STDERR)
> +ActiveRecord::Base.colorize_logging = true
> +
> +ActiveRecord::Base.establish_connection(
> +        :adapter => "monetdb",
> +        :host => "localhost",
> +        :database => "demo"
> +)
> +
> +# Create a new table
> +class AddTests < ActiveRecord::Migration
> +  def self.up
> +    create_table :tests do |table|
> +        table.column :name, :string
> +        table.column :surname, :string
> +    end
> +  end
> +
> +  def self.down
> +   drop_table :tests
> +  end
> +
> +end
> +
> +AddTests.up
> +
> +# Migration: add a column name with a default value
> +class AddAge < ActiveRecord::Migration 
> +  def self.up
> +    add_column :tests, :age, :smallint, :default => 18
> +  end
> +
> +  def self.down
> +    remove_column :tests, :age
> +  end
> +
> +end
> +
> +class Test < ActiveRecord::Base
> +end
> +
> +# Insert an entry in the table
> +Test.create(:name => 'X', :surname => 'Y')
> +
> +# add a column
> +AddAge.up
> +
> +# return the first result of the query SELECT * from tables
> +row = Test.find(:first)
> +printf "SELECT * from tests LIMIT 1:\n"
> +printf "Name: %s, Surname: %s, Age: %s\n", row.name, row.surname, row.age
> +
> +# Drop the table
> +AddTests.down
> +
> +== Rubygem ==
> +
> +The standalone ruby driver can be distributed as a ruby gem.
> +A gem file is already available; however, it can be generated 
> +starting from the ruby-monetdb-sql-0.1.gemspec file:
> +
> +$ gem build ruby-monetdb-sql-0.1.gemspec
> +
> +To install the file run the command:
> +
> +$ gem install ruby-monetdb-sql-0.1.gem
> +
> +Documentation in ri and html format will be generated and installed as well
> +
> 
> U TODO
> Index: TODO
> ===================================================================
> RCS file: /cvsroot/monetdb/clients/src/ruby/TODO,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -d -r1.2 -r1.3
> --- TODO	7 May 2009 15:06:41 -0000	1.2
> +++ TODO	20 May 2009 11:17:12 -0000	1.3
> @@ -1,5 +1,15 @@
> +* implement PROTOCOL 9 login changes
> +
>  * improve activerecord driver
> +
>  * profiling and performance tuning
> +
>  * improve type conversion (do conversion "on demand" as in jdbc driver)
> +
>  * improve tests
> +
>  * code and documentation cleanup
> +
> +* fix syntax errors with ruby 1.9
> +
> +* OSM on rails demo
> 
> 

> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables 
> unlimited royalty-free distribution of the report engine 
> for externally facing server and web deployment. 
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Monetdb-checkins mailing list
> Monetdb-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-checkins


-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list