Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Feb 1, 2012
  1. Bump version to 3.32.0

  2. Refactor serialization_modification_detection to increase performance

    The previous handling was correct, but not performant, as it did
    a serialize/deserialize pair both for new objects and after saving.
    Change the code to just clear the original values after saving
    (which fixes saved objects), and just serialize early for new
    objects (which fixes new objects).
    To make this either, add a private serialize_deserialized_values
    instance method to the serialization plugin, so that the modification
    detection plugin can use it.
    While here, update the RDoc for the modification detection plugin.
  3. Make serialization_modification_detection plugin work correctly with …

    …new objects and after saving existing objects (Fixes #432)
    Previously, the plugin only really worked correctly on existing objects
    loaded from the database before saving.  That's generally the main use
    case, but other cases should be handled as well.  Unfortunately, to
    handle the other cases, on new object creation and after saving, you
    need to serialize and deserialize all of the deserialized columns to
    get clean copies.
  4. Make refreshes after model creation clear the deserialized values in …

    …the serialization plugin
    This is mostly for consistency.  If you want to skip the clearing,
    you can use the skip_create_refresh plugin.
Commits on Jan 31, 2012
  1. @danielb2

    remove whitespace

    danielb2 authored
  2. @danielb2

    fix merge

    danielb2 authored
  3. @danielb2
  4. @knaveofdiamonds
  5. Fix virtual row block handling in select_map/select_order_map if bloc…

    …k returns an array (Fixes #428)
    Before, virtual row blocks were only handled correctly if they only
    returned a single argument, not an array of arguments.  As arrays
    of arguments are now supported, this needed to be fixed.
    In addition to fixing the array handling, this allows you to provide
    both regular arguments and a block argument, just like you can
    for both select and order.
    While here, fix a bug where an alias wasn't recognized if it was a
    string, which broke the handling of SQL::Identifiers with string
Commits on Jan 30, 2012
  1. @danielb2
  2. Document the requirement to provide aliases for expressions in select…

    …_map/select_order_map/select_hash (Fixes #428)
Commits on Jan 29, 2012
Commits on Jan 27, 2012
  1. Change IN/NOT IN handling of empty arrays (Fixes #427)

    Previously, Sequel was inconsistent in it's handling of empty arrays
    used with IN/NOT IN.  It would try to handle NULLs correctly in the
    IN case, but not in the NOT IN case.  This makes correct NULL
    handling the default in both cases.
    The actual behavior difference is that now in the NOT IN case,
    if the left hand side is NULL, the result of the expression is
    NULL instead of true.
    However, the correct NULL handling behavior can cause poor
    performance on databases with a lousy optimizer, such as MySQL.
    So there is a Sequel.empty_array_handle_nulls setting to change
    the behavior so it performs well, but may not handle NULLs
      {:b => []}
      # (b != b)
      ~{:b => []}
      # (1 = 1)
    New Default:
      {:b => []}
      # (b != b)
      ~{:b => []}
      # (b = b)
    Sequel.empty_array_handle_nulls = false:
      {:b => []}
      # (1 = 0)
      ~{:b => []}
      # (1 = 1)
    "Correct" here is actually an opinion, not a fact.  You could
    certainly argue that the static true/false behavior makes more
    logic sense.  However, the default empty array behavior is
    certainly more consistent with the behavior in the non-empty
    array case.
Commits on Jan 25, 2012
  1. Fix a couple links on the documentation page

    Also, remove the link to the Merbcamp 2008 presentation, since it
    seems to be broken.
Commits on Jan 24, 2012
  1. Support ActiveModel 3.2 in the active_model plugin, by adding support…

    … for to_partial_path
    This mostly copies the ActiveRecord implementation, though there
    may be slight differences.
Commits on Jan 23, 2012
  1. A couple column default related fixes

    On SQLite, wrap column defaults in parens, as the SQLite parser
    complains without parens in certain cases such as function calls.
    On MySQL, if Sequel::CURRENT_TIMESTAMP is used as the default
    value of a DateTime/Time column, use timestamp instead of datetime
    as the underlying type.  This shouldn't cause any regressions,
    since previously MySQL would raise an error in this case.
  2. Fix schema integration specs to actually test #tables/#views/#indexes

    The way these were conditionally included caused them to be skipped
    on most adapters.

    Alex Vinnik authored
Commits on Jan 20, 2012
  1. Make set_column_type not modify defaults and NULL/NOT NULL setting on…

    … MSSQL, H2, and SQLite
    This adds some integration tests for this behavior, and fixes
    the cases where it wasn't behaving properly.  This is tricky on
    MSSQL, because defaults are stored as constraints, and you need
    to drop the constraint when altering the column type.
    I wanted to get this working with derby, but limitations in derby
    make testing the feature difficult (can't have a NOT NULL constraint
    on a column that has a NULL default), so I have the tests marked
    pending there.
Commits on Jan 19, 2012
  1. Qualify identifiers when filtering/excluding by associations

    Before, the code used unqualified identifiers, which can be
    ambiguous if there are joins.  This qualifies the related
    identifiers, allowing use with datasets that select from
    multiple tables.
  2. Fix typos

Commits on Jan 13, 2012
  1. Work around table_exists? issue on derby with new SELECT NULL syntax

    Derby must do some aggressive optimization, where if you don't actually
    need the table, it doesn't even check if it exists.  So refactor the
    default handling to make it easy to override, and override it for
  2. Make table_exists? better handle tables where you don't have permissi…

    …ons for all columns (Fixes #422)
    This should reduce the potential for error if you don't have
    permissions for all columns.  It should also be faster for
    tables where each row is quite large.
    If you don't have permissions for the table itself, you may
    still get a false negative, so note that in the RDoc.
    While here, only rescue DatabaseErrors, as StandardError is a
    bit too broad.  It is possible this will break adapters that
    don't wrap their DatabaseErrors, but at this point I'm going
    to consider those as adapter bugs that should be fixed in the
Something went wrong with that request. Please try again.