Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > ANN: Sequel 0.3.3 Released

Reply
Thread Tools

ANN: Sequel 0.3.3 Released

 
 
ciconia@gmail.com
Guest
Posts: n/a
 
      11-04-2007
Sequel version 0.3.3 has just been released. This release includes
extensions for easily specifying relative time stamps and a simple
worker thread implementation for asynchronous processing.

Sequel is a lightweight ORM library for Ruby. Sequel provides thread
safety, connection pooling and a simple and expressive API for
constructing database queries and table schemas.

Following is a discussion of the changes:

=== Numeric Extensions

Sequel now includes extensions to the Numeric class to make it easier
to specify time units and relative time stamps. This feature is based
on the functionality provided in Rails. These extensions are disabled
by default. To enable numeric extensions, include the following in
your code:

Sequel::NumericExtensions.enable

You can easily specify time in minute, hour, day and week units:

1.minute #=> 60
2.hours #=> 7200
3.days #=> 3 * 86400
1.week #=> 7 * 86400

You can also specify time relative to the current time using #from_now
and #ago:

3.hours.from_now
1.week.ago

And also time relative to a given time stamp:

3.hours.before(t)
4.days.since(t)

=== Worker threads

Sequel now includes a worker thread implementation, which can be
useful in cases where you need to perform database operations while
iterating over records. Jobs are added to the worker by calling
Worker#add with a block:

worker = Sequel::Worker.new
Item.filter(:active => true).each do |i|
worker.add {i.set(:name => i.name.capitalize)}
end
worker.join

You can also have the worker wrap all its jobs with a transaction by
specifying a database when creating a new worker:

worker = Sequel::Worker.new(DB) #transaction is begun
Item.filter(:active => true).each do |i|
worker.add {i.set(:name => i.name.capitalize)}
end
worker.join # transaction is commited

=== More info

Sequel project page:
<http://code.google.com/p/ruby-sequel>

Sequel documentation:
<http://sequel.rubyforge.org>

Join the Sequel-talk group:
<http://groups.google.com/group/sequel-talk>

Install the gem:
sudo gem install sequel

Or check out the source and install manually:
svn co http://ruby-sequel.googlecode.com/svn/trunk sequel
cd sequel
rake install


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANN: Sequel 0.1.3 Released - now with DBI support! Sharon Rosner Ruby 0 05-20-2007 11:33 AM
ANN: Sequel 0.1.2 Released Sharon Rosner Ruby 0 05-19-2007 01:08 PM
ANN: Sequel 0.1.0 Released Sharon Rosner Ruby 0 04-22-2007 07:20 PM
ANN: Sequel 0.0.20 Released Sharon Rosner Ruby 0 04-18-2007 08:57 PM
ANN: Sequel 0.0.19 Released and Sequel discussion list Sharon Rosner Ruby 0 04-16-2007 09:48 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57