Permalink
Commits on Nov 1, 2012
  1. Bump version to 3.41.0

    jeremyevans committed Nov 1, 2012
Commits on Oct 31, 2012
  1. Add bin/sequel usage guide

    jeremyevans committed Oct 31, 2012
    The command line usage (-h) output is pretty slim, and many
    interesting features were only mentioned in past release notes.
    This offers a central location for bin/sequel information.
    Currently, the explanations are fairly brief, but I'll certainly
    consider expanding the explanations if I get some specific
    feedback.
  2. Make Dataset#reverse and #reverse_order accept virtual row blocks

    jeremyevans committed Oct 31, 2012
    I didn't realize this didn't already work until I tried it and
    found that the block is ignored.
Commits on Oct 29, 2012
  1. Allow delayed evaluation to bubble up in condition specifiers

    jeremyevans committed Oct 29, 2012
    This makes it so you can do:
    
      DB[:a].where(:b=>Sequel.delay{c})
    
    and have the query use the correct operator depending on the type
    of c.  Previously, it would always have used the default =
    operator.
  2. Add Sequel.delay for generic delayed evaluation

    jeremyevans committed Oct 29, 2012
    The Sequel dataset layer has lacked a generic delayed evaluation
    utility before this.  For dates/timestamps, it's recommended to
    use Sequel::CURRENT_DATE and Sequel::CURRENT_TIMESTAMP instead of
    a delayed Date.today or Time.now, and most other places where
    delayed evaluation could be useful (e.g. model associations),
    Sequel already handles by creating a new dataset every time.
    
    Still, I think a generic delayed evaluation facility is useful
    to have, and since it is fairly simple to implement and I may
    want to use it internally in the future, I decided to add it to
    the core library.
  3. Don't have a separate method of UNLOGGED

    jeremyevans committed Oct 29, 2012
    Database specific SQL doesn't need separate methods, it can access
    the constants directly.
    
    While here, reformat the if statement to use standard Sequel
    format, and move the raise inside the if so options[:temp] isn't
    checked twice.
  4. Make uniqueness validations correctly handle nil values

    jeremyevans committed Oct 27, 2012
    Previously, the uniqueness validations did not work correctly for
    nil values, since they checked if there were other rows where
    (column IS NULL).  However, in SQL, NULL = NULL is not true, and
    multiple rows are allowed to have NULL values in a column with a
    unique constraint.  So skip the uniqueness check if the value is
    nil.
    
    If you have a UNIQUE NOT NULL column, you should have a separate
    presence check to check for the nil values.
Commits on Oct 28, 2012
Commits on Oct 26, 2012
  1. Fix recursive mutex lock in connection_validator extension

    jeremyevans committed Oct 26, 2012
    The connection_validator extension was checking connections
    for validity while holding the pool mutex.  This greatly
    reduces the concurrency and can result in a recursive mutex
    lock if the validation itself requires a connection (which
    is true on some adapters if the validation SQL was not
    cached).
    
    Instead of wrapping next_available, wrap acquire, which is
    not called with the mutex lock.  Manually do locking of the
    necessary data structures when modifying them.
  2. Add ConnectionPool#pool_type to get the type of connection pool in use

    jeremyevans committed Oct 26, 2012
    You can't use is_a? easily to check the type, since the class
    may not be loaded.
Commits on Oct 25, 2012
  1. Explicitly mark primary keys as NOT NULL on SQLite

    jeremyevans committed Oct 25, 2012
    SQLite, in violation of the SQL standard, does not consider
    primary keys as being NOT NULL.  For integer primary keys,
    it automatically makes them autoincrementing, so if you
    attempt to insert NULL, it just ignores you and uses the
    next autoincrementing integer.  For non-Integer primary
    keys, it will happily allow NULL values.  This explicitly
    marks primary key columns as NOT NULL, so SQLite behaves
    more like other SQL databases.
  2. Fix typo on ConnectionValidator extension docs

    rosenfeld committed Oct 25, 2012
    avialable -> available
Commits on Oct 24, 2012
  1. Add connection_validator extension for automatically checking connect…

    jeremyevans committed Oct 24, 2012
    …ions and transparently handling disconnects
    
    This extension is primarily designed for users whose idle
    database connections are automatically disconnected from the
    database after a given period of time.  However, it can also
    be used to handle all disconnects by validating connections
    at every checkout, though that may hurt performance significantly.
    
    This shouldn't cause any problems with transactions or special
    connection states, since code that relies on either isn't even
    yielded a connection until after the validation check has been
    run.
  2. Add spec for disconnect_connection being called more than once

    jeremyevans committed Oct 24, 2012
    Some parts of Sequel may call disconnect_connection on an
    already disconnected connection, so that's something that
    should work.
    
    I've seen freezes in do/postgres after checking connections
    for validity, so just skip those specs on do/postgres.
  3. Refactor/split methods in the threaded connection pools

    jeremyevans committed Oct 24, 2012
    This splits off a couple methods in the threaded connection pools,
    next_available returns the next available connection or nil, and
    checkin_connection returns a connection to the pool.
  4. Fix Database#log_connection_execute on tinytds

    jeremyevans committed Oct 24, 2012
    TinyTDS requires that you handle the result, so just ignore it
    by calling each on it.
  5. More lenient specs looking for current times

    jeremyevans committed Oct 24, 2012
    When testing against a database hosted on another machine,
    the 2 second window is just too tight.  Increase it to
    60 seconds.
  6. Modify the adapter specs to skip checking for specific SQLs in some c…

    jeremyevans committed Oct 24, 2012
    …ases
    
    If the SEQUEL_NO_CHECK_SQLS environment variable is defined,
    skip the checks for specific SQLs, only check for correct
    behavior.  This is useful if you are using an extension that
    modifies the queries that will be sent to the database.
    
    Remove the specific hack in the postgres adapter that already
    did this partially for auto parameterization.  Tests with the
    auto parameterization extension should set the environment
    variable instead.
Commits on Oct 23, 2012
  1. Add Database#valid_connection? for checking whether a given connectio…

    jeremyevans committed Oct 23, 2012
    …n is valid
    
    This is not currently used by other parts of Sequel, but I plan
    to use it in a future extension.
  2. Make dataset.limit(nil, nil) reset offset as well as limit (Fixes #571)

    jeremyevans committed Oct 23, 2012
    Note that you should probably use unlimited instead of limit(nil,nil).
Commits on Oct 22, 2012
  1. Fix a core spec failure on JRuby 1.7

    jeremyevans committed Oct 22, 2012
    My guess is be_a_kind_of doesn't end up getting defined in
    BasicObject on JRuby 1.7, causing this spec to fail.  So
    tweak things slightly so it passes there.
  2. Fix MSSQL default_constraint_name on JRuby 1.7

    jeremyevans committed Oct 22, 2012
    JRuby 1.7 defines BasicObject#object_id, whereas MRI does not.
    Maybe that is a bug in JRuby 1.7, but it's simple to work around.
  3. Update CHANGELOG

    jeremyevans committed Oct 22, 2012