Last Update: 2024-02-01 08:27:41 -0800

New Features

  • A transaction_connection_validator extension has been added. This extension allows for transparently switching to a new connection if a disconnect error is raised while trying to start a transaction, as long as a connection was not already checked out from the pool when the transaction method was called. Transparent reconnection is safe in this case, since no user code is retried.

    This extension can have lower overhead than the connection_validator extension if that is configured to check for validity more often than the default of one hour. However, it only handles cases where transactions are used. It can detect disconnects that would not be detected by default with the connection_validator extension, since that extension defaults to only checking validity if the connection has not been used in the last hour.

  • Sequel now supports a create_table :without_rowid option on SQLite, to create a table WITHOUT ROWID, for better performance in some cases. Users are encouraged to read the SQLite documentation on WITHOUT ROWID before using this option.

  • The sqlite adapter now supports a :regexp_function_cache option, if the :setup_regexp_function option is set to :cached. The :regexp_function_cache option should be a Proc (returning a cache object to use), or a class. It’s possible to use ObjectSpace::WeakKeyMap as the value of the option on Ruby 3.3+ to avoid the memory leaks that are possible when using :setup_regexp_function option :cached value with dynamic regexps.

  • The duplicate_columns_handler extension now supports specifying the on_duplicate_columns option as a connection string parameter.

Other Improvements

  • The list plugin now honors the :top option for the position when adding the first item to the list, instead of always using 1.

  • Regexp matches on SQLite are now faster on Ruby 2.4+, using Regexp#match?.

  • The uniqueness validation in the validation_helpers plugin now uses empty? instead of count == 0, for better performance.

  • On Ruby 3.4+, Sequel uses the timed_queue connection pool instead of the threaded connection pool by default. This should make it so no existing applications are affected by the default switch. This should hopefully allow ample testing of the timed_queue connection pool. At some point in the future, if no problems are repoted, Sequel will likely switch to using the timed_queue connection pool by default on Ruby 3.2+.

Backwards Compatibility

  • Sequel now warns by default if using eager_graph/association_join with an association that uses a block, in the cases where the block would be ignored and there are no appropriate graph options set. In Sequel 6, this warning will be turned into an exception. It is recommended that users use the auto_restrict_eager_graph plugin to turn this into an exception now, or use the :graph_use_association_block option so that the block is not ignored when graphing.