- An :extensions Database option is now supported, which will load the named
extensions into the Database before any connections are initiated:
DB = Sequel.connect('mock:///', :extensions=>[:error_sql, :synchronize_sql])
DB = Sequel.connect('mock:///?extensions=error_sql,synchronize_sql')
- A :connect_sqls Database option is now supported, which will issue the
given queries on all new connections:
DB = Sequel.connect('postgres:///', :connect_sqls=>[
'SET random_page_cost = 1.0',
"SET default_tablespace = 'foo'"
])
- DatasetModule#reverse has been added for simpler use of descending orders:
class Foo < Sequel::Model
dataset_module do
reverse :newest_first, :created_at
end
end
Foo.newest_first.first(10)
- A synchronize_sql extension has been added. This extension checks out a
connection around SQL string creation, and is useful in the cases where
escaping values in the query requires a connection and a large number of
values need to be escaped.
- The following features are now supported on MariaDB 10.2+:
- Common table expressions.
- Window functions.
- Dropping CHECK constraints. Older versions of MariaDB/MySQL ignored CHECK
constraints that were added, and Sequel did not attempt to filter
them out, so Sequel did not
require changes to add CHECK constraints. MariaDB 10.2 CHECK constraints
work correctly with Sequel‘s
constraint_validations extension/plugin.
- Raising CHECK constraint violations as Sequel::CheckConstraintViolation
instances.
- Recognizing curdate() as Sequel::CURRENT_DATE when used as the default
value for a date column.
- Date::Infinity values are now supported in the pg_extended_date_support
extension:
DB.convert_infinite_timestamps = :date
This returns infinite dates/timestamps as Date::Infinity instances, and
literalizes Date::Infinity instances correctly.