README.md in tobox-0.4.0 vs README.md in tobox-0.4.1

- old
+ new

@@ -266,9 +266,23 @@ ```ruby on_error_worker { |exception| Sentry.capture_exception(exception) } ``` +### `on_database_connect { |db| }` + +Callback executed right after initializing the `sequel` database object. This can be used, for example, to load database-level extensions and plugins, and set parameters (such as connection pool tweaks). This callback will also be used by plugins which instantiate its own separate database objects (such as in the case of the [stats](#stats) plugin). + +This callback won't be executed if the database object is created outside of `tobox` configuration parameters. + + +```ruby +on_database_connect do |db| + db.extension(:connection_validator) + db.pool.connection_validation_timeout = -1 +end +``` + ### `message_to_arguments { |event| }` if exposing raw data to the `on` handlers is not what you'd want, you can always override the behaviour by providing an alternative "before/after fetcher" implementation. ```ruby