Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Dec 19, 2008
  1. @jeremyevans

    Make Sequel raise an Error if you attempt to subclass Sequel::Model b…

    jeremyevans committed
    …efore setting up a database connection
Commits on Dec 18, 2008
  1. added changelog entry for ValidationFailed changes

    TJ Vanderpoel committed
  2. Added Sequel::ValidationFailed exception to handle cases

    TJ Vanderpoel committed
    where raise_on_save_failure is set and a record save
    fails because the validations did not pass
  3. @jeremyevans
Commits on Dec 17, 2008
  1. @jeremyevans

    Fix literalization of blobs on PostgreSQL.

    jeremyevans committed
    It looks like using extended strings for blobs was a bad idea.
    Apparently, they were fine with standard strings.  The use
    of extended strings caused problems when standard conforming
    strings was ON (which is the the default in Sequel).
Commits on Dec 15, 2008
  1. @jeremyevans

    Make Database#schema raise an error if given a table that doesn't exi…

    jeremyevans committed
    …st (Fixes #255)
    Before, some adapters (at least PostgreSQL and SQLite) wouldn't raise
    an error if given a table that didn't exist.  Instead, you would end
    up with an empty schema for those tables.  Because the schema
    existed, even if it was empty, Database#table_exists? would return
    true if asked about those tables.  Generally, this bug would show
    up in the following code:
      class Blah < Sequel::Model
      Blah.table_exists? # True even if blahs is not a table
    This makes Database#schema raise an error if the adapter gives it
    an empty schema description, since a database table should have at
    least one column.  This prevents the empty description from being
    added to the schema hash, which makes table_exists? not give
    the wrong answer when asked if the table exists.
  2. @jeremyevans

    Make Model#inspect call Model#inspect_values private method for easie…

    jeremyevans committed
    …r overloading (Thanks bougyman)
Commits on Dec 13, 2008
  1. @jeremyevans

    Update the plugin page to take into account sequel extensions that ar…

    jeremyevans committed
    …en't model plugins, and add my sequel_postgresql_triggers extension
Commits on Dec 11, 2008
  1. @jeremyevans

    Add methods to create and drop functions, triggers, and procedural la…

    jeremyevans committed
    …nguages on PostgreSQL
    Fairly straightforward code to support the CREATE FUNCTION, CREATE
    LANGUAGE commands on PostgreSQL.  Includes some decent but not all
    inclusive specs.
Commits on Dec 10, 2008
  1. @jeremyevans

    Add external documentation links to website, starting with Lori Holde…

    jeremyevans committed
    …n's Merb And Sequel presentation
Commits on Dec 9, 2008
  1. @jeremyevans
  2. @jeremyevans
  3. @jeremyevans
  4. @jmhodges @jeremyevans
  5. @jmhodges @jeremyevans
Commits on Dec 6, 2008
  1. @jeremyevans

    Bump version to 2.8.0

    jeremyevans committed
Commits on Dec 4, 2008
  1. @jeremyevans

    Back to 100% code coverage

    jeremyevans committed
  2. @jeremyevans

    Fix the SingleThreadedPool's handling of disconnected connections

    jeremyevans committed
    This shows that while 100% code coverage may not fix all bugs, it
    certainly helps find some.
  3. @jeremyevans

    Fix Database#upcase_identifiers? if Sequel.upcase_identifiers = true

    jeremyevans committed
    Note to self that using ||= with a boolean variable is a recipe for
  4. @jdunphy @jeremyevans

    Oracle adapter change to catch connection errors and reraise a Sequel…

    jdunphy committed with jeremyevans
Commits on Dec 3, 2008
  1. @jeremyevans
  2. @jeremyevans
  3. @jeremyevans

    Support literal strings with placeholders and subselects in prepared …

    jeremyevans committed
    Before, the following two types of prepared statements did not work:
      DB[:items].filter("id = ?", :$i).call(:select, :i=>1)
      DB[:items].filter(:id=>DB[:items].select(:id).filter(:id=>:$i)).call(:select, :i=>1)
    The first issue is because a placeholder string was literalized
    immediately, before the dataset was extended with the prepared
    statement code.  The second issue is because the arguments given in
    the main prepared statements weren't passed into any subselects.
    This commit fixes both of those issues.  It also makes the name
    argument to Dataset#prepare optional.
    Fixing the first issue is done by adding an
    SQL::PlaceholderLiteralString class that holds the string with
    placeholders as well as the arguments, and not literalizing them
    until the SQL string is needed.
    Fixing the second issue was a lot more work, It is done by adding a
    Dataset#subselect_sql private method that literal calls, and
    overriding it in the PreparedStatement module that extends the
    dataset, which takes the subselect dataset, turns it into a prepared
    statement, and does the magic necessary pass the args in
    (if the default emulated support is used).  It required changes to
    the argument mappers so they didn't rely on instance variables.
    Instead of using a hash, they now use an array that is shared with
    any subselects.  The mapping code is simpler and the code in
    general is more generic.  This does away with prepared_args_hash,
    as it is no longer necessary.
Commits on Dec 2, 2008
  1. @jackdempsey @jeremyevans
  2. @jeremyevans
  3. @jeremyevans

    Have the connection pool remove disconnected connections when the ada…

    jeremyevans committed
    …pter supports it
    This adds a Sequel::DatabaseDisconnectError (subclass of
    Sequel::DatabaseError), for signaling to the connection pool that the
    connection was lost.  It changes the connection pool code to rescue
    that exception and remove the offending connection from the
    connection pool.
    In order to implement this, a disconnection_proc had to be added to
    the connection pool.  Sequel uses a generic one that calls
    Database#disconnect_connection.  disconnection_proc is called both
    when connections are removed because the connection was lost and
    when Database#disconnect is called.  Database#disconnect now calls
    @pool.disconnect, which now uses the disconnection_proc if no
    block is provided.  All adapters have been modified to remove
    Database#disconnect and define Database#disconnect_connection, which
    was fairly easy since all defined #disconnect methods just called
    @pool.disconnect with a block that disconnected each connection.
    The only adapter that currently supports this is PostgreSQL.  The
    PostgreSQL adapter used to silently attempt to reconnect, which
    might have caused the same SQL to be used twice. I'm not sure it
    could have happened, but I'm not sure it couldn't have happened
    either.  Now, if the database connection is lost, it raises
    DatabaseDisconnectError, the connection pool removes the connection
    from the pool, and raises the error to the application.  If the
    application wants to continue, it can always retry.
    While mucking in the connection pool, I found a bug where the
    wrong key could be used when new connections were created.  This
    wasn't a huge issue in most cases, but it could have caused as
    many as twice the number of max_connections connections to be
  4. @jeremyevans
  5. @jeremyevans

    Add stored procedure support for the MySQL and JDBC adapters (Fixes #252

    jeremyevans committed
    This commit adds support for database stored procedures, with an API
    similar to Sequel's prepared statement support, and implemented
    internally in a similar way.  While it is directly callable on the
    Database object (via #call_sproc), that use is discouraged.  Instead
    it should be used at the dataset level with the following API:
      DB[:table].call_sproc(:select, :mysp, 'first param', 'second param')
      # or
      sp = DB[:table].prepare_sproc(:select, :mysp)'first param', 'second param')'third param', 'fourth param')
    The only adapters with support for this are MySQL and JDBC (if using
    a database that supports it).  Other databases don't even expose this
    API.  Adding support to other databases should be fairly easy, though
    I have no plans to at present.
    The stored procedure implementation is similar to the prepared
    statement implementation at the Dataset level.  #call_sproc and
    and returning a clone of the dataset,and overriding Dataset#execute
    and related functions to add options that are used by
    Database#execute to send the request to the Dataset#call_sproc
    While working on stored procedure support, it became necessary to fix
    the MySQL adapter to make it handle multiple results, since MySQL
    stored procedures require that.  This also fixed issues with using
    multiple statements at once in the MySQL adapter.  Before, this would
    cause a "commands out of sync" error message that wasn't easily
    recoverable from.  The MySQL adapter now supports this, though the
    JDBC adapter connecting to MySQL still barfs when you attempt this.
    Additionally, fix the socket tests in the MySQL adapter to use the same
    user, password, and database.
Commits on Dec 1, 2008
  1. @jeremyevans
  2. @jeremyevans

    Support AliasedExpressions in tables when using implicitly qualified …

    jeremyevans committed
    …arguments in joins
    This allows you to do:
      DB.from(, :a=>:b)
      #=> ... FROM i AS j INNER JOIN k AS l ON (l.a = j.b)
  3. @jeremyevans
  4. @jeremyevans

    Support Dataset#except on Oracle

    jeremyevans committed
    This commit changes the Oracle adapter to use MINUS instead of
    EXCEPT, since that's the syntax that Oracle supports.
  5. @jeremyevans

    Raise Errors if EXCEPT/INTERSECT is used when not supported

    jeremyevans committed
    This adds a couple of modules to Sequel::Dataset that can be included
    in adapters that don't support EXCEPT/INTERSECT.
    UnsupportedIntersectExcept raises an error if EXCEPT/INTERSECT is
    used, and UnsupportedIntersectExceptAll raises an error if
    The Informix, MySQL, MSSQL, and Progress adapters use
    UnsupportedIntersectExcept and the Oracle and SQLite adapters use
    Similar code was already in the MSSQL and Progress adapters, this
    commit removes that code.  Also, it removes some commented out code
    from the Informix adapter.
  6. @jeremyevans

    Fix ordering of UNION, INTERSECT, and EXCEPT statements (Fixes #253)

    jeremyevans committed
    Before, the UNION, INTERESECT, and EXCEPT statements came after
    ORDER BY by default, this commit moves them before ORDER BY.  Some
    of the adapters were changed, but not all.  If you use UNION,
    INTERSECT, or EXCEPT, please test with your database to make sure it
    still works.
Commits on Nov 26, 2008
  1. @jeremyevans

    Fix the oracle adapter spec

    jeremyevans committed
Something went wrong with that request. Please try again.