Permalink
Commits on Aug 26, 2013
  1. add Database#supports_index_conditions? and return correct value for …

    mluu committed Aug 26, 2013
    …MSSQL adapter
Commits on Aug 25, 2013
  1. Remove hooks updating the cache by default from the static_cache plugin

    jeremyevans committed Aug 25, 2013
    While this initially seemed like an easy way to keep the cache in
    sync, it would only work if you were using a single process to make
    changes.  As soon as you scale to multiple processes, it wouldn't
    work.  So it doesn't make sense to even offer it as a default.
    
    The only safe way to do this is to have the cache invalidation be
    initiated by the database, as the pg_static_cache_updater handles
    it.
Commits on Aug 23, 2013
  1. Support :frozen=>false option in static_cache plugin, for having new …

    jeremyevans committed Aug 23, 2013
    …instances returned instead of frozen cached instances
    
    This is designed to work with the new pg_static_cache_updater
    extension, allowing for normal model creates, updates, and
    deletes, with the updater taking care of updating the cache.
    
    By default, automatically update the class by default when using
    the model instance API to save or destroy objects.  But allow
    that to be disabled via :reload_hooks=>false, so that when
    using the pg_static_cache_updater, you don't reload the cache
    twice.
    
    Disallow saving/destroying existing instances when the plugin
    is used without :frozen=>false.  This isn't backwards compatible,
    but was the original intention.  In most cases this doesn't
    change behavior, as existing objects in the cache were frozen and
    saving/destroying them was disallowed anyway.
  2. Make sure loose_count returns an Integer in pg_loose_count

    jeremyevans committed Aug 23, 2013
    This is stored as a float in the PostgreSQL system catalogs,
    but users probably expect a count to return an integer.
  3. Add pg_static_cache_updater Database extension for listening for chan…

    jeremyevans committed Aug 23, 2013
    …ges to tables and updating static_cache caches automatically
    
    This makes it possible to use the static_cache plugin for models
    where the underlying table can change at runtime.  Assuming you
    meet the criteria for using the extension, it should now be
    possible to use the static_cache plugin for any model whose
    dataset is small and not frequently updated.
Commits on Aug 22, 2013
  1. Support LATERAL queries via Dataset#lateral

    jeremyevans committed Jun 18, 2013
    To use LATERAL queries, you tag the dataset you want to use with
    Dataset#lateral, and when the subquery is literalized, LATERAL
    is prepended to it:
    
      DB.from(:a, @dataset.from(:b).lateral).sql
      # SELECT * FROM a, LATERAL (SELECT * FROM b) AS t1"
    
    LATERAL is supported on Postgres 9.3rc1+, HSQLDB, and DB2. It can
    be emulated on Microsoft SQL Server using the
    mssql_emulate_lateral_with_apply extension, which uses CROSS/OUTER
    APPLY for the emulation.
Commits on Aug 21, 2013
  1. Fix RDoc for dataset extensions to show they return clones

    jeremyevans committed Aug 21, 2013
    The previous RDoc makes it look like Dataset#extension modifies
    the dataset in place, when it actually returns a clone.  So use
    an assignment to reflect that it returns something useful.
  2. Add from_block Database extension, for having Database#from block aff…

    jeremyevans committed Aug 21, 2013
    …ect FROM instead of WHERE
    
    I wish I realized this was an issue a few months ago, so I could
    have made this the default in Sequel 4.  But this change is too
    large to go into a minor release, so I won't be able to make it
    the default until Sequel 5.  In the meantime, this extension
    makes it easy to get the desireable behavior.
  3. Minor cleanup for :cursor_name commit

    jeremyevans committed Aug 21, 2013
    Now that a specific identifier can be chosen, quote the name to
    avoid SQL injection issues.
    
    Also, change the spec to test for nested cursor use, since that's
    the reason to implement the option.
  4. Fix placeholder literal strings when used with an empty placeholder h…

    jeremyevans committed Aug 21, 2013
    …ash (Fixes #695)
    
    We don't want to fall through and hit the else branch, since then
    things break if ? is used in the string.
  5. Do not allow SQL placeholders to override ::cast syntax

    Jeff Tucker committed Aug 21, 2013
Commits on Aug 5, 2013
  1. Add license to gemspec

    jeremyevans committed Aug 5, 2013
Commits on Aug 1, 2013
  1. Bump version to 4.1.1

    jeremyevans committed Aug 1, 2013
  2. Fix select_map, select_order_map, and single_value methods on eager_g…

    jeremyevans committed Aug 1, 2013
    …raphed datasets
    
    ungraphed on an eager_graph dataset restores the row proc, so
    switch things so that naked is called after ungraphed so that
    the row proc is always removed.  Issue pointed about by Caesium
    on IRC.
  3. Bump version to 4.1.0

    jeremyevans committed Aug 1, 2013
Commits on Jul 31, 2013
Commits on Jul 29, 2013
  1. Handle dropping indexes for schema qualified tables on PostgreSQL

    jeremyevans committed Jul 29, 2013
    PostgreSQL doesn't accept schema qualification when adding indexes,
    assuming that the index will always be placed in the same schema
    as that table.  So make the same assumption when dropping
    an index from a table, using the table's schema.
Commits on Jul 25, 2013
  1. Add Database#error_info on PostgreSQL 9.3+ if pg-0.16.0+ is used, to …

    jeremyevans committed Jul 25, 2013
    …get a hash of metadata for a given database exception
    
    This just attempts to offer a simpler interface to the underlying
    ruby-pg error metadata extraction methods.
  2. Missed some redundant lines.

    dividedmind committed Jul 25, 2013
Commits on Jul 22, 2013
  1. Allow prepared_statements plugin to work with instance_filters and up…

    jeremyevans committed Jul 22, 2013
    …date_primary_key plugins
    
    Previously, it was documented that the plugins didn't work
    together.  It makes sense that they can't, since prepared statements
    require the same behavior for every call, and instance_filters
    and update_primary_key plugins can have different behavior depending
    on instance state.
    
    However, it was annoying that they don't work together, since the
    behavior is that things appear to work, but the instance_filters
    or update_primary_key behavior is just ignored, since prepared
    statements overrides methods at a higher level.
    
    So the simplest fix is just to have prepared_statements plugin
    not use a prepared statement and fallback to the default behavior
    in that case.  Unfortunately, the only way I can think of to do
    that reliably is to have a base instance method defined, and have
    other plugins override it.  So that's basically what I did, adding
    a method to Model::InstanceMethods inside the plugin, and having
    other plugins override it.  This implementation means that it
    doesn't matter in which order you load the plugins or where you
    load them in the class hierarchy.
  2. Minor cleanup for deferrable exclusion constraints

    jeremyevans committed Jul 22, 2013
    Only run the spec on PostgreSQL 9.0+, and test for behavior and
    not for specific SQL.
Commits on Jul 18, 2013
  1. Make Database#run and #<< accept SQL::PlaceholderLiteralString values

    jeremyevans committed Jul 18, 2013
    This allows the following to work:
    
      DB << Sequel.lit("Some SQL with ? and ?", :foo, :bar)
  2. Support :drvconnect option in odbc adapter for supplying the ODBC con…

    jeremyevans committed Jul 18, 2013
    …nection string directly
    
    Previously, there wasn't a way to specify the ODBC connection
    string directly.  The :driver option used a similar ruby ODBC
    interface, but it created a connection string that was probably
    broken.  Since it doesn't look like such connection strings work,
    I'm deprecating that interface.
Commits on Jul 16, 2013
  1. Added support for deferrable exclude constraints

    Mike Foody committed Jul 16, 2013
  2. Support mysql2 0.3.12+ result streaming via Dataset#stream

    jeremyevans committed Jul 16, 2013
    I wrote the specs for this over a year ago, before the first beta
    of 0.3.12 was released.  Thankfully, the implementation was fairly
    easy, with the only tricky part being error handling for streamed
    datasets where not all rows were retrieved.
  3. Remove enum example from cheat sheet, since it doesn't work on Postgr…

    jeremyevans committed Jul 16, 2013
    …eSQL
    
    PostgreSQL requires a separate CREATE TYPE for each enum.