Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Sep 1, 2011
  1. Bump version to 3.27.0

Commits on Aug 24, 2011
Commits on Aug 19, 2011
  1. @semmons99
Commits on Aug 15, 2011
Commits on Aug 12, 2011
  1. Add support for native prepared statements to the tinytds adapter

    The dataset part is mostly borrowed from the sqlite support.  The
    database part is based on code in the ActiveRecord SQL Server
    adapter (thanks metaskills).
  2. Add support for native prepared statements and stored procedures to t…

    …he mysql2 adapter
    The mysql and mysql2 adapters are very similar, so this extracts
    the existing support from the mysql adapter into a shared adapter
    that both the mysql and mysql2 adapter can use.
    mysql2 doesn't appear to support stored procedures that return
    results, but it does support other types of prepared statements.
    I think this could be fixed by setting flags when connecting,
    but I'm not sure that Mysql2 supports the same flags that
    Mysql does (it has CLIENT_PS_MULTI_RESULTS but not
Commits on Aug 11, 2011
  1. Add specs for Model#pk_or_nil

    This used to be used internally by the eager graphing code, before
    it was refactored last month.  As it is a public method, it can't
    just be removed, so make sure it is specced, even though it's now
    deprecated and shouldn't be used.
  2. Support dropping primary key, foreign key, and unique constraints on …

    …MySQL via the drop_constraint :type option
    MySQL doesn't support the SQL standard DROP CONSTRAINT syntax. It
    requires you specify the type of constraint you want to drop. So
    previously Sequel's drop_constraint method did not work at all
    on MySQL.  With this commit, you can add a :type => :foreign_key,
    :primary_key, or :unique option to drop that type of constraint.
    Note that there is no way to drop a check constraint, as they don't
    exist on MySQL (they are parsed and accepted but ignored).
  3. Add Sequel::SQLTime class for handling SQL time columns

    SQL time columns store only a time component without a date
    component.  The ruby stdlib doesn't have an appropriate class to
    represent such values, as both Time and DateTime store both date
    and time parts.  When given a Time value, Sequel assumes you
    want it formatted as a timestamp (including both the date and time
    parts), since that's much more common and a Time value includes
    both date and time parts.
    This adds Sequel::SQLTime, a subclass of Time, that when literalized
    only uses the time component.  It changes the database adapters when
    possible to return time columns as Sequel::SQLTime instances, so that
    you can successfully roundtrip such values.  It changes the
    typecasting to convert input values for time columns to SQLTime
  4. Fix some small issues with timezone handling, and add typecast specs

    This makes  Sequel.*_to_*_timestamp accept a hash of values, moving
    similar handling from the typecasting code, but also handling things
    correctly in regards to Sequel's timezone settings.
    It also changes the way Date objects are handled, by always assuming
    they are in the application timezone.  So if you provide a Date
    object, the resulting object will always have 0 hour, 0 minutes,
    and 0 seconds.  Before, if application_timezone was different
    than dateabase_timezone, the result may have had a fractional
    day values.
    It also fixes an issue where typecasting a DateTime object to
    Date would return the DateTime object.  Now it returns a Date
    No specs added for typecasting to time values, since that is changing
Commits on Aug 10, 2011
  1. Add Model.dataset_module for simplifying many def_dataset_method calls

    This can be used to clean up a bunch of def_dataset_method calls:
      Artist.def_dataset_method(:foo) do
      Artist.def_dataset_method(:baz) do |x|
        x + 2
      Artist.dataset_module do
        def foo
        def baz(x)
          x + 2
    This also makes the dataset methods significantly faster as
    the methods are no longer closures.  So even for only a single
    dataset method, it makes sense in performance sensitive situations.
    Another benefit is that since the methods are defined normally
    instead of using define_method with a block, argument handling
    is stricter.
Commits on Aug 6, 2011
  1. Make prepared_statements_safe plugin work on classes without datasets

    Among other things, this makes it simple to enable this plugin for
    all of your models:
      Sequel::Model.plugin :prepared_statements_safe
    This also fixes the case where set_dataset is used after the plugin
    has been added.
Commits on Aug 5, 2011
  1. Make Dataset#hash work correctly when referencing SQL::Expression ins…

    Thanks to Aaron Pfeifer for the bug report.
Commits on Aug 4, 2011
  1. Handle allowed mass assignment methods correctly when including modul…

    …es in classes or extending instances with modules
    Before, including a module in a class would not clear the setter
    cache, so if the module included a setter method you wanted to
    allow, it may have been ignored.  Likewise, if you extended the
    object with a module containing a setter method, that didn't set
    the flag to ignore the model class's cache.
    In both cases, the handling is unconditional, it doesn't check
    that the module includes a setter method.  That may change in the
    future, but shouldn't cause any problems now.
  2. Fix Model#hash to work correctly with composite primary keys and with…

    … no primary key
    Previously Model#hash only handled the single primary key case
    correctly.  With no primary key, it raised an error, and with
    composite primary keys, it didn't correctly handle the case
    where one or more of the primary key fields is NULL.
  3. Model#exists? now returns false without issuing a query for new model…

    … objects
    Previously, it could return true if you set the primary key field
    in advance and the value already existed in the database.  However,
    attempting to insert the object would cause an error due to the
    duplicate primary key.
    This does break backwards compatibility, but nobody should have
    been relying on the old behavior.
Commits on Aug 1, 2011
  1. Bump version to 3.26.0

Commits on Jul 29, 2011
  1. Fix connection in mysql adapter with :port=>"1234"

    This can happen if the connection information is stored in yaml.
    When a connection string is used, the URI library turns the port
    into an integer, but that does not happen if an options hash is
    used directly, and parsing yaml to get an options hash will
    generally result in string values.
Commits on Jul 22, 2011
  1. Allow :pool_class option to take a :symbol

    This allows you to load connection_pool classes via
    :pool_class=>:foo, as long as inside the
    sequel/connection_pool/foo.rb file, you set
    CONNECTION_POOL_MAP[:foo] = self.
    No connection pool class currently uses this, but it's possible
    nondefault connection pool classes will be added in the future,
    and if so, they will need this.
  2. Fix bug in default connection pool if a disconnect error is raised an…

    …d the disconnection_proc also raises an error
Commits on Jul 18, 2011
  1. Disallow eager loading via eager of many_*_many associations with :ea…

    …ger_graph option
    This combination (eagerly loading via eager, :many_*_many
    association, :eager_graph option), was supposedly supported
    earlier, and even had specs (but no integration tests).  Well, the
    specs had invalid SQL in them (referenced tables only used in
    subqueries), so they could never work on a real database.
    Since this apparently never worked correctly, I'm just removing
    the feature.  Fixing it would complicate the EagerGraphLoader,
    and probably make it slower, and as apparently nobody is using
    the feature, there's no point to having it.  I'm open to adding the
    feature back at a later point if someone submits a patch that uses
    the correct SQL (not hard), fixes the the EagerGraphLoader to
    handle it (also not hard, most of the code needed is being removed
    in this commit), and includes a full integration test suite.
    This feature was written before Sequel used integration tests, which
    is why there were no integration tests for it.  I didn't actually
    catch the problem with the SQL until writing the integration test
    for it.
    I don't think this causes any backwards compatibility issues, other
    than you may get a Sequel::Error raised instead of a
  2. Fix LocalJumpError when eager loading many_to_many associations with …

    …the identity_map plugin without an active identity map
Commits on Jul 17, 2011
  1. Major speedup in dataset creation

    This takes the setting of the @quote_identifiers,
    @identifier_input_method, @identifier_output_method, and @row_proc
    out of Dataset#initialize and delays their initialization until
    they are needed.  This makes dataset creation about 2.5x faster on
    1.8 and 4.4x faster on 1.9, and dataset cloning about 40% faster
    on 1.8 and 20% faster on 1..
    The tradeoff is about a 33% decrease in performance of
    input_identifier and output_identifier, which are not usually
    called directly.  Overall performance decrease during literalization
    is very small.  This is likely to be an overall performance benefit
    for almost all Sequel code.
  2. Number all RDoc section titles in Dataset and Database classes

    hanna-nouveau sorts by section title, so the RDoc will finally
    display sections in a sensible order.
  3. Use hanna-nouveau instead of hanna as the RDoc template

    mislav's original hanna only works on RDoc 2.3.  It's pretty much a dead
    end development wise.  hanna-nouveau is a fork that works with modern
    versions of RDoc (currently 3.8).
    This uses hanna-noveau if a modern version of RDoc is used, and
    should still retain backwards compatibility with really old versions
    of RDoc.  I'm not sure if it works with newer RDoc if you don't have
    hanna-nouveau installed, though.
  4. Fix rare issue in the postgres adapter

    I've only seen this happen once, where the ensure block raised an
    exception because q was false.  This check should at least do no
Something went wrong with that request. Please try again.