Commits on Aug 1, 2012
  1. Bump version to 3.38.0

    committed Aug 1, 2012
Commits on Jul 31, 2012
  1. Add a > 0 check for double(x, y) unsigned

    This is already done for unsigned integers and bignums, so it makes
    sense to do so for double as well.
    committed Jul 31, 2012
Commits on Jul 30, 2012
  1. Remove some spec guards related to swift

    Some of the swift/sqlite specific ones were added recently to
    work around memory issues in swift-db-sqlite3, which have been
    fixed in version 0.1.2.  Others also appear to be run correctly
    and should be enabled.
    committed Jul 30, 2012
  2. Make swift/postgres adapter work with hstore, requires swift-db-postg…

    …res 0.2.0+
    This sets the native_bind_format setting which causes
    swift-db-postgres not to do the ? -> $n conversion that breaks
    the hstore ? operator.
    committed Jul 30, 2012
Commits on Jul 26, 2012
  1. The swift adapters now require swift-db-* instead of swift itself (Fi…

    …xes #526)
    This is a squashed commit of Pull Request 526, along with some
    local changes by me, including:
    * Using :pass instead of :password so that connections that require
      passwords work.
    * Requiring the swift-db adapter instead the subadapter instead
      of the main adapter proc.
    * Adding appropriate guards to the specs.  Currently, hstore
      ? operators are broken on swift/postgres just like on do/postgres.
      Also, swift/sqlite is not completely stable, so add guards for
      the specs that cause it to crash (see
      deepfryed/swift-db-sqlite3#1 for details).
    One good thing about this change is that with the swift-db-*
    adapters, you only need to install the related gem, you don't need
    to install dbic++.
    committed Jul 26, 2012
Commits on Jul 25, 2012
  1. Add :textsize option to tinytds adapter to override the default TEXTS…

    …IZE (Fixes #525)
    The default TEXTSIZE setting on tinytds is about 64k, which is
    pretty small.  While you can override the setting in freetds.conf,
    for some users (Windows users using a binary gem), that might not
    be the easiest change to make.  Allow a :textsize option to manual
    set the setting for each connection.
    While here, initialize the mssql unicode strings setting on
    initialization instead of on connection.
    Add a spec that tests >64k of data, and switch some test tables
    to use generic types instead of specific types.
    committed Jul 25, 2012
Commits on Jul 23, 2012
  1. Support an output identifier method in the swift adapter

    This probably hurts performance, but it's the only way to get
    output identifiers working.  Since we're already taking a hit
    since we started handling blobs correctly, we might as well
    support output identifiers.
    committed Jul 23, 2012
  2. Add info on internationalization to validation_helpers RDoc

    Most of this code comes from mmontossi on IRC, thanks to him
    for sharing.
    committed Jul 23, 2012
  3. Don't load schema, hook_class_methods, or validation_class_methods by…

    … default in specs
    Since they were split from the base model support in Sequel 3.0,
    the plugin specs loaded them globally into the Sequel::Model
    class.  That's a bad idea, as it could hide dependencies in the
    specs.  Make the specs behave better by only adding the plugin
    to a Sequel::Model subclass.
    committed Jul 23, 2012
  4. Add Model#to_hash as an alias to Model#values

    Since Sequel::Model is designed to be a wrapper around Hash that
    adds some behavior, I think it makes sense to have a to_hash method.
    committed Jul 23, 2012
  5. Don't do a runtime check for conversion proc for string types in pg_row

    If a member of a composite type is a string type, then don't setup
    a runtime check for a conversion proc, since that could hurt
    committed Jul 23, 2012
  6. When loading multiple pg_* extensions via Database#extension, only re…

    …set the conversion procs once
    Before, the conversion procs would be reset for every extension,
    instead of only once.  This wasn't usually a big deal before,
    but with pg_row and pg_hstore, reseting the conversion procs
    requires database access, so it's best to eliminate the
    redundant queries.
    committed Jul 23, 2012
  7. Reuse existing timestamp conversion proc

    Instead of creating a new one via a method, reuse the existing one.
    This saves on memory and is more correct in the case a custom
    conversion proc for timestamps is used.
    committed Jul 23, 2012
  8. Don't allow model typecasting from string to postgres array, hstore, …

    …or composite types
    User input for typecasting is very unlikely to come in a String
    in PostgreSQL output format. The only reason a string was allowed
    before was to allow the do/postgres, swift/postgres, and
    jdbc/postgres adapters to work with the typecast_on_load
    plugin.  Now that the pg_typecast_on_load plugin has been added,
    this feature is no longer needed and should be removed.
    The parsers for these types were written expecting it only to
    be called with database output.  However, typecasting is called
    with user input.  I don't know of any vulnerabilities in the
    parsers, but as they weren't designed with security in mind,
    it's better to protect them from user input.  At the very least,
    the pg_array parser without sequel_pg is quite slow, so for large
    input it's an easy DoS target.
    Other types such as interval, inet, range, and json have much
    simpler parsers that shouldn't pose any security issues, plus it's
    conceivable that input could come in the form of a string for
    those types.
    committed Jul 23, 2012
  9. Add pg_typecast_on_load plugin for converting advanced PostgreSQL typ…

    …es on load the {jdbc,do,swift}/postgres adapters
    This allows the do/postgres, swift/postgres, and jdbc/postgres
    adapters to handle the custom types similarly to how the
    native postgres adapters handles them.  Currently, the typecast
    on load plugin could be used, but that will soon not be possible
    for some types.
    committed Jul 23, 2012
  10. Make all postgres adapters store conversion procs

    Instead of just being used by the native postgres adapter, now
    all adapters that connect to PostgreSQL have conversion procs.
    This makes it easier for the pg_* extensions to work with any
    of the adapters.
    In the native postgres adapter, instead of copying connection
    procs on first connection, do so upon initialization.  This
    is less racy, more correct, and results in simpler code.  Note
    that it won't actually check out a connection upon
    initialization unless it needs one to do a name->oid mapping.
    Cleanup some shared initialization code by adding an
    initialize_postgres_adapter private method.
    Change the private get_conversion_procs method to no
    longer accept an argument, so modify callers appropriately.
    While here, update the mock postgres adapter to setup sqls
    data structure early, so that it works with these changes.
    Also, have it implement the bound_variable_arg method, so
    some postgres specs don't need to add it manually.
    Also, rename convertor to converter in pg_array spec and
    some rdoc.
    committed Jul 23, 2012
  11. Add the type oid to the column schema on PostgreSQL

    This can be used to take a column and string and cast the
    string to a database type, the same way the native postgres
    adapter does when retrieving the column.
    committed Jul 23, 2012
Commits on Jul 20, 2012
  1. Don't require pg_array extension when loading pg_row

    I originally planned to make it automatic so that composite
    types in bound variables would work.  However, since the
    Database needs to be extended with a module, just loading
    the pg_row extension will not ensure that.  The user needs
    to manually load the pg_array extension first.
    committed Jul 20, 2012
  2. Cleanup PG_TYPES in the specs

    These specs register types in PG_TYPES, a global constant, which
    can cause failures in other specs.  Reset PG_TYPES after the spec
    runs to avoid the issue.
    committed Jul 20, 2012
  3. Add support for PostgreSQL row-valued types

    The adapter specs for these were all interrelated, so it was
    easiest to combine them all into a single commit.
    committed Jul 20, 2012
Commits on Jul 19, 2012
  1. Support :typecast_methods_module when registering custom array types

    This should make it possible to register custom array types on
    a per-Database instance without affecting global state.
    The singleton define_array_typecast_method moves from DatabaseMethods
    to PGArray, and is now private.  That's a backwards incompatible
    change, but it's unlikely anyone is relying on it.
    committed Jul 19, 2012
  2. Allow custom registered array types in the pg_array extension to take…

    … a :type_procs option
    This will be used to handle per-Database instance registered types.
    committed Jul 19, 2012
  3. Require the core extensions when migrating

    This doesn't currently matter, but as the core extensions will be
    removed in the next major version, it's best to make the change
    now so it isn't forgotten.
    Basically, old migrations may rely on the core extensions, and
    Sequel tries hard not to break old migrations.
    committed Jul 19, 2012
  4. Preserve return value in MiniTest example

    The return value of MiniTest::Unit::TestCase is significant and needs
    to be returned in order for the test reporter to work properly.
    I also added an example for overriding the base implementation instead
    of doing it in a subclass.
    mjackson committed Jul 19, 2012
Commits on Jul 18, 2012
Commits on Jul 17, 2012
  1. Remove Sequel::SQL::IdentifierMethods

    This module was only included in Symbol, and only would make
    sense for Symbol and String.  Since it only defines a single
    method, Instead of including a separate module, just define
    the identifier method on String.
    committed Jul 17, 2012
  2. Don't have schema dumper produce code that depends on the core extens…

    Instead of using String#lit, use
    Note that Sequel.lit would also work, but that got added recently,
    while has been around forever.  Since
    it's possible that migrations dumped with a recent version of
    Sequel could be restored on a lower version of Sequel, it's best
    to use something more backwards compatible.
    committed Jul 17, 2012
Commits on Jul 16, 2012
  1. Remove some spec guards on jdbc/oracle

    These were fixed after the refactoring of the blob bound argument
    spec refactoring.
    committed Jul 16, 2012