Permalink
Commits on Dec 1, 2010
  1. Bump version to 3.18.0

    jeremyevans committed Dec 1, 2010
Commits on Nov 30, 2010
  1. Allow the user to control how the connection pool deals with attempts…

    jeremyevans committed Nov 30, 2010
    … to access shards that aren't configured
    
    Connection pools now take a :servers_hash option that will be used
    as the hash for the servers.  The default for this option is
    Hash.new(:default), so that attempts to access unconfigured shards
    end up using the default shard (the same as Sequel's historical
    behavior).
    
    You can use something like Hash.new(:read_only) to automatically
    use the :read_only shard.  If attempts to access an unconfigured
    shard should be considered an error, you can use a hash with
    a default proc that raises an error, allowing easier detection
    of this case.
  2. Typecast columns when creating model objects from JSON in the json_se…

    jeremyevans committed Nov 30, 2010
    …rializer plugin
    
    This changes the logic to try the setter method before just modifying
    the values hash for the model's columns.  The values will still be
    modified for columns that don't have an available setter method, or
    where the setter method is restricted (e.g. primary key columns).
    
    Since the setter methods are being used for intake, the output
    code has been changed to call the getter methods instead of directly
    getting the value from the values hash.
Commits on Nov 23, 2010
  1. When parsing the schema for a model that uses an aliased table, use t…

    jeremyevans committed Nov 23, 2010
    …he unaliased table name
    
    Before, it used the alias name, which could produce incorrect
    results.
  2. When emulating schema methods such as drop_column on SQLite, recreate…

    jeremyevans committed Nov 23, 2010
    … applicable indexes on the recreated table
    
    I found this bug while working on the reversible migrations support.
    Basically, on SQLite, most schema methods that alter a table, other
    than adding a column, require dropping the table and recreating it.
    In order to support a method like drop_column, internally Sequel
    will drop the table and create a new table with the column dropped.
    Before, indexes weren't copied over from the old table to the new
    table.  Now, Sequel will parse the indexes from the old table,
    and recreate the indexes on the new table as long as all columns
    are still available.
Commits on Nov 22, 2010
  1. The instance_hooks plugin now only removes hook pairs that have been …

    jeremyevans committed Nov 22, 2010
    …run successfully
    
    Previously, any successful save would remove all instance hooks.
    That usually didn't cause a problem, but if a user added a
    before_destroy hook to an object, saved the object, and then
    destroyed the object, the before_destroy hook would not be
    run, since it was removed when the object was saved.
    
    This commit changes things so that only related instance hooks
    are removed.  This is simplest and I think the most logical
    behavior.
  2. Update CHANGELOG

    jeremyevans committed Nov 22, 2010
  3. Don't remove method_missing from Sequel::BasicObject on ruby 1.8

    jeremyevans committed Nov 22, 2010
    Rubinius seems to require this method, otherwise it gives
    StackErrors in some cases.
  4. Add support for reversible migrations

    jeremyevans committed Nov 20, 2010
    This is obviously based on similar support added recently to
    ActiveRecord by Aaron Patterson (thanks Aaron for this idea!).
    
    See the updated documentation for information about how to
    use this feature.
Commits on Nov 17, 2010
  1. Add missing COMMA_SEPARATOR constant to shared SQLite adapter

    jeremyevans committed Nov 17, 2010
    This is needed for identifier_list.
  2. Update CHANGELOG

    jeremyevans committed Nov 17, 2010
  3. Move the private Dataset#identifier_list method method into the SQLit…

    jeremyevans committed Nov 17, 2010
    …e adapter
    
    The SQLite adapter was the only user of the method, so it shouldn't
    be in the main method.  This breaks backwards compatibility if
    other code was calling the private method.
  4. Add to_dot extension

    jeremyevans committed Nov 17, 2010
    This adds a Sequel::Dataset#to_dot method.  The to_dot
    method returns a string that can be processed by graphviz's dot
    program in order to get a visualization of the dataset.  Basically,
    it shows a version of the dataset's abstract syntax tree.
    
    Idea stolen from Aaron Patterson's similar method in ARel 2.
  5. Add to_dot extension

    jeremyevans committed Nov 16, 2010
    This adds a <tt>Sequel::Dataset#to_dot</tt> method.  The +to_dot+
    method returns a string that can be processed by graphviz's +dot+
    program in order to get a visualization of the dataset.  Basically,
    it shows a version of the dataset's abstract syntax tree.
    
    Idea stolen from Aaron Patterson's similar method in ARel 2.
Commits on Nov 16, 2010
  1. Add better compatibility with previous SQLite versions

    jeremyevans committed Nov 16, 2010
    The previous commit handled the 1.3.x series of ruby-sqlite3, this
    new one adds support for the earlier 1.2.x series, tested with
    version 1.2.4.
Commits on Nov 10, 2010
  1. Do manual type_translation in the SQLite adapter

    jeremyevans committed Nov 10, 2010
    sqlite3-ruby's internal support for type translation is going away
    in 2.0.0, so switch to using a proc system in the sqlite adapter
    similar to the one used in the MySQL and PostgreSQL adapters, though
    using strings as keys instead of integer type ids.
    
    This works almost perfectly, but there is a minor backwards
    compatibility issue.  Previously, Sequel assumed a timestamp
    or datetime field that was a single integer was a unix epoch
    integer datetime.  That complicated things and I don't think
    anyone uses it, so it's no longer supported.
Commits on Nov 9, 2010
Commits on Nov 5, 2010
  1. Bump version to 3.17.0

    jeremyevans committed Nov 5, 2010
Commits on Nov 3, 2010
  1. Ensure that the optimistic locking plugin increments the lock column …

    John Firebaugh
    John Firebaugh committed Nov 3, 2010
    …when using Model#modified!
  2. Correctly handle nil values in the xml_serializer plugin, instead of …

    jeremyevans committed Nov 3, 2010
    …converting them to empty strings (Fixes #313)
    
    This adds a nil='' attribute to the XML tag if the value should be
    nil.  Kind of ugly, but gets the job done.  This makes nil values
    roundtrip successfully, but it's up to the consumer of the XML to
    recognize the nil attribute and act appropriately.
  3. Use a default wait_timeout that's allowed on Windows for the mysql an…

    jeremyevans committed Nov 3, 2010
    …d mysql2 adapters (Fixes #314)
    
    Another MySQL stupidity rears its ugly head.  For some reason, MySQL
    has different allowed value ranges for wait_timeout depending on the
    server OS used.  The previous default value that Sequel used was
    above the limit allowed on Windows.  This lowers the value to the
    maximum allowed on Windows, for both the mysql and mysql2 adapters.
Commits on Nov 2, 2010
  1. Fix Database#each_server when used with jdbc or do connection strings…

    jeremyevans committed Nov 2, 2010
    … without separate :adapter option
    
    Database#each_server calls Sequel.connect with the current Database
    instance's options.  Unfortunately, for jdbc and do connection
    strings, the connection string itself is not parsed into options,
    it is passed directly to the underlying adapter.  Because of this,
    the :adapter option is not filled in, and when #each_server calls
    connect with the options hash, no :adapter option is present and
    you got an error.
    
    You could previously work around this using the :adapter option
    specificially, but that was an ugly fix.  This makes all Database
    instances store an :adapter_class option that points to the
    adapter class currently being used.  That way, when each_server
    is called, the correct adapter class will always be used.
  2. Update CHANGELOG

    jeremyevans committed Nov 2, 2010
Commits on Oct 29, 2010
  1. Fix missing guard on offset.

    bhauff committed Oct 29, 2010
Commits on Oct 12, 2010
  1. Allow cloning of many_through_many associations

    jeremyevans committed Oct 12, 2010
    This relaxes the API of many_through_many to accept a hash as
    a second argument.  This allows it to work with with the :clone
    option.  You can also now specify the :through array as the
    value of the :through key, instead of as a separate argument.