Speed up integration tests

Use before(:all) and after(:all) where it's not too invasive to
speed things up.  The biggest benefit occurs when creating or
dropping tables is performance intensive.

Also, remove clear_sqls from the integration tests.  This hasn't
been used in a very long time.
Add some ordering in the associations intergration to fix some non-determinism
Move a couple transaction specs

This fixes a failure in the mysql adapter on rbx after the
before(:all) change.
Apply the correct pragmas when connecting to SQLite via the Amalgalite and Swift adapters

The sqlite and jdbc/sqlite adapter already do this.
Refactor Database#alter_table slightly

Add a private apply_alter_table method that does the work.  This
will be used shortly for SQLite, and will make further improvements
easier, such as combining multiple alter table statements into a
single query on some databases.
Emulate more alter table operations on SQLite

This adds support for emulating add_constraint and drop_constraint
operations.  Sequel duplicates the table if the alter table needs
to be emulated, but it can't completely duplicate everything. For
example, unique constraints are not duplicated, but primary key
and foreign key constraints are.  This makes dropping primary key
constraint drop any primary key constraint.  This makes dropping
any foreign key drop all foreign key constraints on the table,
since the foreign key constraint is by name and Sequel doesn't
know which column is being referenced by the constraint name.

When adding constraints, previous constraints other than primary
key and foreign key constraints are dropped, and the new
constraints are added.

In order for self-referential foreign key constraints to be added
correctly, this changes the order of things when duplicating
a table.  It used to be the new table was created with a backup
name, and then renamed to the correct name.  Now, the old table
is renamed to the backup name, and the new table is created with
the correct name.

In addition to fixing 4 integration tests on SQLite, this also
fixes the handling of composite primary keys when using the
emulated alter table support.
Add Sequel.guarded? to the integration tests

cspecify (short for checked specify) will check this method to
decide whether the block should be pending or not.  This allows
the guarding code to be reused elsewhere, so you don't need to
do INTEGRATION_DB.database_type ==.

This also removes log_specify from the specs, as the plain log
method work fine.
Parsing primary key information from system tables in the shared MSSQL adapter

Before, primary key information was not parsed, so if you were
not using Sequel's convention of an id primary key column, you
had to specify the primary key column manually when using models.
Now, it should just work by default, as it does in the other
adapters.
Small fix to postgres adapter for $SAFE=1
Don't allow Model.def_dataset_method to override private model methods
Add note to named_timezones extension that support depends on the adapter
Refactor some association code

Move code for qualifying of association keys with table names into
the association reflection to DRY up quite a bit of code.

Split eager_loading_dataset into two methods so that part of it
can be reused for an upcoming commit.

The :eager_block association option is now called before the
:eager_graph association has been applied instead of after.

A bug when eager loading a many_through_many option with
composite keys that requires an alias for one of the join
tables has been fixed.

Model classes now need to have a dataset before using the
association methods.
Add dataset_associations plugin for making dataset methods that return datasets of associated objects

This makes it easy to do things like:

  Artist.filter(:name > 'M').albums.filter(:name < 'M').tracks

To get a dataset of tracks where the album's name comes before
M and the artist's name comes after M.
Use FileUtils::RUBY instead of RUBY in the Rakefile, to work with rake 0.9
Reverse a guard for the RcteTree integration tests
Handle methods with names that can't be called directly in Model.def_dataset_method

Not that anyone should be setting up dataset methods with names
derived from user input, but I could see someone adding dataset
methods based on column names, which could contain spaces.
Fix line offset for evaled code in the thread local timezones extension
Fix some error handling in the db2 adapter

Recognize that DB2CLI::SQL_NO_DATA_FOUND does not indicate an
error, and handle invalid handle and still executing errors
with disconnects.  Also, show the underlying error type or type
code in the exception message for easier debugging.
Refactor error checking in db2 adapter to use a block

This also uses a constant instead of a class variable for the null
handle, and removes the override of test_connection since it is
the same as the default.
Recognize decimal(10, false) and decimal(10, true) as decimal types

The db2 adapter needs this for decimal types to be returned
as :decimal.