Double speed of Model#new with empty hash, and quadruple speed of Model#set with empty hash

This just does a fast exit in the case that the hash is empty.
Model#initialize_set is supposed to be called for all new model
objects, so that couldn't be skipped.  This does call Hash#empty?
twice in the new? case, but if the hash is empty, the earlier check
makes it about 20% faster, and if the hash is not empty, there's
the extra call does not cause a significant slowdown.
Update CHANGELOG and fix RDoc for multi_replace commit
Better handling of exclusive options in bin/sequel

Instead of trying to check all combintions, just add each
exclusive option to an array, and error if more than one of the
options is used.
Add schema_caching extension, to speed up loading a large number of models by loading cached schema information from a file

This idea is taken from ActiveRecord, which will be adding the
feature in 4.0.  Basically, when loading a large number of
models, there may be significant time spent loading the table
schema for each table from the database, especially in high
latency situations.

To work around this, you can cheat by caching the information to
a file, and then loading the cached file instead of querying the
database for each table/model, which is what this extension does.

To make it easy to generate the cached schema files, an -S option
is being added to bin/sequel that creates the cached schema dump
file.  It's up to the application to use load_schema_cache to
preload the schema cache.
Database#uri and #url now return nil if a connection string was not used when connecting (Fixes #453)

Before, Sequel attempted to create a URI using the the Database's
options, which only worked in simple cases.  Now, the URI given
when connecting is used verbatim, or nil is returned.

This also modifies inspect to include the URI and/or connection
options given when connecting, so it's easy to see exactly which
options were used.

This breaks backwards compatibility for Database#uri and #url.
Before, they would either return a string or raise an exception,
now they can return nil or a string, but never raise an exception.
Add null_dataset extension, for creating a dataset that never issues a database query

This is another feature that ActiveRecord will be adding in 4.0.
Basically, it's the null object pattern for datasets, so you can
create a dataset that never returns any rows (or issues other
queries).

This is easily implemented as an extension, where Dataset#nullify
just extends the cloned dataset with a module.

Note that there may be corner cases on some adapters when using
non-standard dataset methods.  Those can be dealt with on a
case by case basis.
Fix a typo in the schema generator RDoc
Recognize unsigned tinyint types in the schema dumper
Minor RDoc fix for postgres #analyze method
Split pretty_table extension into two extensions

This extension is being split in two so that it can be used by
core Sequel code without adding Dataset#print.  Also,
PrettyTable.string has been added to get the string to print,
which there previously was not a way to do.

As the split extension (_pretty_table) is for internal use,
this won't be documented on the plugins page).
Make SQLite's explain use PrettyTable and return a string

Previously, it returned an array, but for compatibility with the
postgres adapter, it now returns a string.  This breaks backwards
compatibility, but I think it's a worthwhile change.

Also for compatibility, explain now accepts an argument, which is
currently ignored.  Reading SQLite explain output isn't easy, but
at least it is possible to pick out what queries are using an index
and what queries are not.
Add Dataset#explain on MySQL

I thought that MySQL already supported explain, but it turns out it
does not.  MySQL's explain sucks compared to PostgreSQL's, but it's
definitely better than SQLite's.

Like SQLite, use the pretty table code to return nice looking tables.
Fix Dataset#group_rollup/#group_cube on Microsoft SQL Server 2005

This adds some branching to select_group_sql to deal with the three
cases:

1) no ROLLUP/CUBE
2) standard ROLLUP/CUBE support using ROLLUP()
3) nonstandard ROLLUP/CUBE support using WITH

Previously MySQL just overrode select_group_sql to use WITH ROLLUP,
so just have it use the standard code, setting the flag to turn
on the correct syntax.

As SQL Server will be removing WITH ROLLUP/CUBE in a later version,
only use the WITH ROLLUP/CUBE code on SQL Server 2005, where
ROLLUP()/CUBE() was not supported.
Add Database#create_join_table and #drop_join_table for easily creating simple join tables for models

This is another feature that will be in ActiveRecord 4.
Unfortunately, the Sequel API is not as nice, as Sequel core does not
have any inflections support.  So there is no way to infer the key
names from the table, since tables are generally plural and keys are
generally singular (or at least that's the default for Sequel::Model
join tables).

This is the simplest API that I can think of that allows it, taking
a hash with foreign key column symbols pointing to table name
symbols:

  create_join_table(:cat_id=>:cats, :dog_id=>:dogs)

While the API is not as nice as just listing the table names,
Sequel's implementation has the following advantages:

1) Real foreign keys (via REFERENCES)
2) A composite primary key of the two foreign keys
3) An additional composite index reversing the order of the keys.

The composite primary key and additional index makes it so that most
common join table queries can benefit from one of the two indexes.

While here, add support to the migration reverser to use
drop_join_table in the down block if create_join_table is used in the
change block.
Add Database#convert_infinite_timestamps to the postgres adapter, can be set to :nil, :string, or :float (Fixes #454)

Unfortunately, there's not a good way to handle these timestamps,
as neither Time nor DateTime supports infinite timestamps.
ActiveRecord uses infinite floats for these values, which makes
sense in some cases, but I don't think is a good default.  By
default, values returned from a timestamp column should be either
nil (for NULL) or an instance of Sequel.datetime_class.  By using
float automatically, you can silently end up with floats later in
your code where DateTime/Time is expected, and Float and
DateTime/Time have different APIs (no Float#strftime).

Like the MySQL invalid datetime setting, Sequel forces you to
configure appropriately if you want to deal with infinite floats.
You can choose to either return them as nil, an infinite float,
or just the string given.

This code is currently only in the native postgres adapter.  The
other adapters can't convert on retrieval.  It's possible they
could use the typecasting code, but then that can no longer be
conditional on the convert_infinite_timestamps setting being
enabled.
Expand create_join_table to handle some additional options

With these options, create_join_table should handle almost all
join table creation needs.
Minor spec cleanups for recent commits
The :on_update and :on_delete entries for foreign_key can now take strings, which are used literally

This simplifies the logic so that instead of using a case
case statement, the argument is always converted to a string and
processed.  The only behavior changes are for callers that didn't
use one of the symbols previously supported, which resulted in
NO ACTION being used.  The previous behavior is likely to swallow
errors that should be caught, so it should be changed.

Since they are no longer needed, this removes the Database constants
CASCADE, NO_ACTION, SET_DEFAULTS, SET_NULL, and RESTRICT.  That
breaks backwards compatibility too, but nobody should be relying
on those constants.

While here, add a separate method for on_update_clause, simply
because having both :on_delete and :on_update use on_delete_clause
looks wrong.
Model#set_fields and #update_fields now respect :missing=>:skip and :missing=>:raise options for handling missing values

These new options allow set_fields and update_fields to handle more
cases.  :skip is probably more useful of the two options, since it
allows the methods to handle situations previously handled by
set_only and update_only, with a much simpler implementation.

To ease use with web frameworks that use hashes with strings, if
a symbol is given and doesn't exist in the hash, check for the
string version and use that if present.
Add Dataset#to_hash_groups and #select_hash_groups for getting a hash with arrays of matching values

I've needed something like this in multiple projects, and I suspect
it's a reasonably common need that people just use a manual loop
for currently.  This allows you to easily categorize a dataset by a
given column(s), with the value of that column(s) as the hash keys,
and an array of all matching values as the hash values.