Permalink
Commits on Mar 1, 2013
  1. Bump version to 3.45.0

    committed Mar 1, 2013
Commits on Feb 28, 2013
Commits on Feb 27, 2013
  1. Remove bad model typecasting of money type on PostgreSQL (Fixes #624)

    Typecasting money strings to decimal doesn't work, since it
    doesn't handle the locale-specific strings.  The dataset
    changes were made a while back, but the model typecasting
    code was not updated.
    
    Leave the money/smallmoney typecasting on MSSQL.  It appears
    to work correctly, and I don't want to risk breaking existing
    code that relies on it.
    committed Feb 27, 2013
Commits on Feb 26, 2013
  1. Minor refactoring to validation_class_methods

    The validation_if_proc method is never passed nil, since
    validates_each does not call it if the value is nil. Other changes
    are just style-related.
    committed Feb 26, 2013
  2. Load the ActiveSupport blank extension first when running extension t…

    …ests
    
    This allows the Sequel blank extension to just overwrite the AS
    changes, allowing the code to actually be tested.
    committed Feb 26, 2013
  3. Add :nocov: markers to skip ruby version/engine specific code

    SimpleCov makes it possible to eliminate known false positives
    in the coverage testing by marking branches not taken due to
    the specific version/engine used.  This takes advantage of
    that so that it doesn't show files as uncovered just because
    they have 1.8 or jruby/rbx specific code.
    committed Feb 25, 2013
  4. Allow the :pool_timeout option to be a float

    Before, only an integer was allowed.  This is mostly useful for
    testing purposes, since I don't want to have to sleep for a
    second to test the related code.
    committed Feb 25, 2013
  5. Use simplecov instead of rcov for coverage testing on 1.9+

    Rcov never worked well on 1.9, and the latest version doesn't
    support 1.9+ at all.  SimpleCov uses ruby 1.9+'s native coverage
    library, and appears to work well.
    committed Feb 25, 2013
Commits on Feb 24, 2013
Commits on Feb 22, 2013
  1. Fix typo in ConnectionValidator documentation

    "synchonrize" -> "synchronize"
    JackDanger committed Feb 22, 2013
Commits on Feb 21, 2013
  1. Make PostgreSQL metadata parsing handle tables with the same name in …

    …multiple schemas
    
    This changes the PostgreSQL support to correctly handle cases
    where an unqualified table is used, and a table with that name
    exists in multiple schemas. For example:
    
      DB.schema(:foo)
      DB.indexes(:foo)
      DB.foreign_key_list(:foo)
    
    Previously, DB.schema would raise an exception (since it checked
    results to see if they came from the same schema), but indexes and
    foreign_key_list would return information for all tables with
    name foo, no matter the schema.
    
    This refactors the support so that instead of adding a filter for
    the table name (and a filter for the schema name if one is given),
    it always casts to regclass and then oid, and the filter is done
    on the unambiguous table oid.
    
    This new way respects the schema search path, and makes it so that
    DB.schema(:foo) returns information about the table referenced by
    DB[:foo].
    
    This is not completely backwards compatible.  Previously, these
    methods allowed you to reference a table outside the schema
    search path without qualifying it with the schema.  Now, when
    referencing a table outside the schema search path, the schema
    must be specified explicitly.  This mirrors the dataset behavior,
    where referencing a table outside the schema search path without
    qualifying it also raises an exception.
    committed Feb 21, 2013
  2. Better fix for not picking up foreign keys in other databases on MySQL

    @opts[:database] can be nil on do and jdbc, and can be incorrect
    if a USE statement is used, so use the DATABASE() function to get
    the currently connected database.
    committed Feb 21, 2013
Commits on Feb 19, 2013
  1. Switch query extension to use a proxy instead of Object#extend

    This new implementation is a modified version of one developed
    by chanks after discussion on IRC.  The previous version used
    Object#extend at runtime and overrode Datast#clone, and I never
    liked the implementation.  This new implementation is better in
    every way, and almost fully compatible.  There are the following
    small differences:
    
    * Inside of the block, self is a proxy object, not a dataset
      instance.
    
    * This new implementation doesn't try to catch calls to each,
      insert, update, or delete.  However, if you call a method
      that doesn't return a dataset, it raises an error.
    committed Feb 19, 2013
  2. Remove Dataset#def_mutation_method instance method

    The instance method creates a singleton class by defining a
    method on an instance, which is going to invalidate method
    caches in most ruby implementations.  Plus, it's not something
    that should be done.
    
    Replace the need for an instance level def_mutation_method by
    allowing the class level def_mutation_method to take a :module
    option for the module in which to place the defined method.
    If you really want the old behavior, you can call the class
    method with a :module option set to the singleton class of the
    dataset instance.
    
    As def_mutation_method was public, this is a backwards-incompatible
    change.
    committed Feb 19, 2013
  3. Unbreak foreign key parsing on do/mysql and jdbc/mysql

    There should probably be a better way to handle those two
    cases, but just return them to the previous working
    behavior for now.
    committed Feb 19, 2013
  4. Try to raise more accurate error message in serialization failure

    I think it's safe assumption that the more valid error message is
    the first, since we switched to base64 encoding by default about
    5 years ago.
    committed Feb 19, 2013
  5. Allow per-instance overrides of Postgres.force_standard_strings and .…

    …client_min_messages (Fixes #618)
    
    This also includes a small change to handle string escaping in the default
    case if PGconn.escape is not defined (very unlikely).
    committed Feb 19, 2013
Commits on Feb 15, 2013
  1. Add Sequel.tzinfo_disambiguator= to the named_timezones plugin for au…

    …tomatically handling TZInfo::AmbiguousTime exceptions (Fixes #616)
    committed Feb 15, 2013
Commits on Feb 13, 2013
  1. Make ilike use UPPER and LIKE instead of ILIKE by default

    ILIKE is a PostgreSQL extension, so Sequel shouldn't default to
    using it.  All other adapters previously override the handling
    for ilike.  Most of them used UPPER in some form, so just make
    that the default and DRY up some adapter code.
    
    Remove the like_uses_escape? method added recently, and just
    always use ESCAPE.  The only database that didn't support this
    was access, so just override the shared access adapter to not
    use ESCAPE.
    
    This shouldn't an effect for databases that Sequel currently
    supports.  For databases without special support, this should
    make ILIKE work by default.
    committed Feb 13, 2013
  2. Add Dataset#escape_like, for escaping LIKE metacharacters (Fixes #614)

    This is designed for the case where part of a LIKE term is based on
    user input, where you want to escape that part, and then add
    metacharacters to the beginning or ending of the string.
    committed Feb 13, 2013
  3. The LIKE operators now use an explicit ESCAPE '\' clause for similar …

    …behavior across databases
    
    Database behavior for LIKE escaping varies.  PostgreSQL, MySQL,
    and H2 seem to use a backslash escape by default, but most other
    databases require an explicit escape.  All tested databases seem
    to support the ESCAPE clause except Access, so just enable it
    by default except on Access.
    
    This is backwards incompatible for adapters where backslashes
    are not used as LIKE escapes by default and you are using
    a backslash in a LIKE patterns as a non-metacharacter.  The
    workaround is to double the backslash in the pattern.
    committed Feb 13, 2013
Commits on Feb 12, 2013
  1. Make Database#tables and #views accept a :qualify option on PostgreSQ…

    …L to return qualified identifiers
    
    Requested last week by joevandyk.  This is useful on a PostgreSQL
    database where schemas are used, since otherwise you don't know
    which schema the returned table/view is in, and if that schema
    is not in the schema search path, you would be able to use it
    directly.
    committed Feb 12, 2013
  2. Make xml_serializer plugin secure by default

    This contains non-backwards compatible changes to the xml_serializer
    plugin, similar to the changes recently made to the json_serializer
    plugin, and for the same reason.  The new API/options are very
    similar to the json_serializer plugin.  You can get back the old
    behavior using the :all_associations and :all_columns options.
    committed Feb 12, 2013