Hooks called by Active Record

Summary

Hooks

Called on the server once ActiveRecord has finished starting up: the database is connected, the stored schema is restored, the models know their columns and the pending migrations have been run.
Called on the server once the adapter is connected to the database and ActiveRecord has finished starting up, right after the ActiveRecordReady hook.
Called on the server when the adapter fails to connect to the database, after the error has been printed to the console.

Hooks

Called on the server once ActiveRecord has finished starting up: the database is connected, the stored schema is restored, the models know their columns and the pending migrations have been run. It is called even if bringing the database up to date failed. This is the place to load data that has to be in memory from the start. The adapter is in sync mode during the call, so queries made by a handler finish before it returns. DatabaseConnected is run right after it.

Called from

Call sites

Called on the server once the adapter is connected to the database and ActiveRecord has finished starting up, right after the ActiveRecordReady hook. The adapter is still in sync mode during the call, so queries made by a handler finish before it returns.

Called from

Call sites

DatabaseConnectionFailed(error_text)

server packages/active_record/lib/adapters/abstract.lua:372

Called on the server when the adapter fails to connect to the database, after the error has been printed to the console. Only the MySQL and PostgreSQL adapters report a failed connection, and they do not when their binary module is missing.

Parameters

  • error_text String error reported by the database module

Called from

Call sites

Defined in