Commits on Jan 12, 2009
  1. Bump version to 2.9.0

    committed Jan 12, 2009
Commits on Jan 11, 2009
  1. Clean up bin/sequel changes

    Mostly cosmetic changes, but don't require pathname.  Also, change
    --load-models to --load-dir, since it loads all .rb files in the
    directory, not just model files.
    Also, update CHANGELOG.
    committed Jan 11, 2009
  2. Load Models after DB initialization

    Paweł Kondzior committed Jan 11, 2009
  3. Add -L, --load-models DIR options for sequel CLI command that auto lo…

    …ads all Sequel::Models
    Paweł Kondzior committed Jan 11, 2009
Commits on Jan 10, 2009
Commits on Jan 9, 2009
Commits on Jan 8, 2009
  1. Better error messages for BeforeHookFailure and ValidationFailure

    This is inspired by pusewicz's recent patch for better error
    messages in the associations code.  Now, if a ValidationFailure
    occurs, the contents of errors.full_messages will be the error
    message.  If a BeforeHookFailure occurs, it will tell you which
    hook type failed.  It can't tell you which specific hook you used
    failed, though.
    This also changes run_association_callbacks not to call
    save_failure, and changes save_failure's API in a backwards
    incompatible way by removing the second argument.  save_failure is a
    private method which the user shouldn't have been calling directly
    committed Jan 8, 2009
Commits on Jan 7, 2009
  1. Improve fix for MySQL add_foreign_key

    This uses a modified spec from aphyr and supports :on_delete and
    :on_update options.
    committed Jan 7, 2009
  2. Bump copyright year

    committed Jan 7, 2009
  3. Update advanced associations RDoc file with explanation for polymorph…

    …ic association diss and a couple other small changes
    committed Jan 7, 2009
Commits on Jan 6, 2009
  1. Much better support for Dataset#{union,except,intersect}, allowing ch…

    …aining and respecting order
    This commit changes the internal dataset options uses to store
    compound operations such as UNION, EXCEPT, and INTERSECT.  Before,
    each compound operation was under its own key (2 keys really, since
    it used to be :except and :except_all), and the value of the key only
    stored a single dataset value, so chaining calls lost the previous
    value. Also, there was a static order of compound operations, such
    that some databases always had INTERSECT before UNION and some
    databases always had UNION before INTERSECT.  This was a bad way
    to do things that only handled simple cases well.
    This commit changes that to use a single :compounds key that
    stores an array of arrays of 3 items, compound type, dataset,
    and an all flag.  When it comes time literalize the query,
    the compound operations are applied in the order they were
    called on the dataset.  Any order and number of compound operations
    should work, as long as the database supports it.
    By default, Sequel will use a subselect if using a compound
    operation with a dataset that already has a compound operation on it.
    That should work on most databases.  For databases that don't support
    EXCEPT or INTERSECT, a very simple solution is used, as the order
    of UNIONs shouldn't matter (they possibly matter if UNION and UNION
    ALL or mixed, but we'll cross that bridge if we come to it).
    PostgreSQL uses parantheses instead of a subselect to enforce
    ordering of operations.
    In addition to the spec changes, integration tests were also added
    for this bugfix/feature.  They pass on SQLite, MySQL, and PostgreSQL,
    though the MySQL tests are simple as they only test UNION.  Look
    at the integration tests to see what is now possible.
    This commit modifies the Informix, MSSQL, Oracle, and Progress
    adapters without testing them, so if you run one of those databases,
    be sure to test Sequel and make sure things still work.
    committed Jan 6, 2009
  2. Default to logging only WARNING level messages when connecting to Pos…

    The PostgreSQL default for client_min_messages is NOTICE, but this
    creates a lot of unnecessary messages (2 messages per SERIAL PRIMARY
    KEY in a migration, for example).  Sequel now defaults to using
    WARNING.  This can be changed via:
      Sequel::Postgres.client_min_messages = nil # Use Server Default
      Sequel::Postgres.client_min_messages = :notice # Use NOTICE level
    This setting can only be used with the native PostgreSQL adapter.
    This commit also adds RDoc documentation of the metaprogrammed
    module level accessors used by the Postgres adapter to the Postgres
    committed Jan 6, 2009
  3. Fix add_foreign_key for MySQL (thanks aphyr)

    This fix is uglier than I'd like, but it appears to work.  It doesn't
    support :on_update or :on_delete, though.
    committed Jan 6, 2009
  4. Correctly literalize BigDecimal NaN and (+-)Infinity values (Fixes #256)

    This surrounds NaN and Infinity BigDecimal values in quotes when
    literalizing them, which fixes errors on insert, since without quotes
    they are generally treated as column references.  Database support
    for these values is fairly limited, though.
    This modifies the SQLite adapter to handle all three special values
    correctly, and changes it to return BigDecimal whenever the column
    type is numeric, decimal, or money.  This is backwards incompatible,
    but makes SQLite support more consistant with other databases.
    PostgreSQL works with NaN values, but errors if you try to give it
    (+-)Infinity values unless the backing column is a floating point
    column and not a numeric column.
    As is typical for MySQL, it converts all three special values to 0.
    No testing was done on the other adapters, but it is unlikely this
    breaks something that worked before.
    committed Jan 6, 2009
Commits on Dec 19, 2008
  1. Make Sequel raise an Error if you attempt to subclass Sequel::Model b…

    …efore setting up a database connection
    committed Dec 19, 2008
  2. Added BeforeHookException to be raised when raise_on_save_failure

    is set and a before hook fails
    TJ Vanderpoel committed Dec 19, 2008
  3. Revert "Added a new exception to be raised when a before hook fails"

    This reverts commit 9416b6a.
    TJ Vanderpoel committed Dec 19, 2008
  4. Merge branch 'master' of

    TJ Vanderpoel committed Dec 19, 2008
  5. Added a new exception to be raised when a before hook fails

    during validation, when raise_on_save_failure is set
    TJ Vanderpoel committed Dec 18, 2008
Commits on Dec 18, 2008
  1. Added a new exception to be raised when a before hook fails

    during validation, when raise_on_save_failure is set
    TJ Vanderpoel committed Dec 18, 2008
  2. added changelog entry for ValidationFailed changes

    TJ Vanderpoel committed Dec 18, 2008
  3. Added Sequel::ValidationFailed exception to handle cases

    where raise_on_save_failure is set and a record save
    fails because the validations did not pass
    TJ Vanderpoel committed Dec 18, 2008
Commits on Dec 17, 2008
  1. Fix literalization of blobs on PostgreSQL.

    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).
    committed Dec 17, 2008
Commits on Dec 15, 2008
  1. Make Database#schema raise an error if given a table that doesn't exi…

    …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.
    committed Dec 15, 2008
  2. Make Model#inspect call Model#inspect_values private method for easie…

    …r overloading (Thanks bougyman)
    committed Dec 15, 2008
Commits on Dec 13, 2008
  1. Update the plugin page to take into account sequel extensions that ar…

    …en't model plugins, and add my sequel_postgresql_triggers extension
    committed Dec 13, 2008
Commits on Dec 11, 2008
  1. Add methods to create and drop functions, triggers, and procedural la…

    …nguages on PostgreSQL
    Fairly straightforward code to support the CREATE FUNCTION, CREATE
    LANGUAGE commands on PostgreSQL.  Includes some decent but not all
    inclusive specs.
    committed Dec 11, 2008
Commits on Dec 10, 2008
  1. Add external documentation links to website, starting with Lori Holde…

    …n's Merb And Sequel presentation
    committed Dec 10, 2008