Class: PgCron::Adapters::Postgres::Connection Private

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pg_cron/adapters/postgres/connection.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Decorates an ActiveRecord connection with methods that help determine the connection's capabilities.

The F(x) equivalent asks about DROP FUNCTION argument lists. The capability that matters here is whether pg_cron is installed at all: cron.job does not exist until CREATE EXTENSION pg_cron has run, and that additionally requires pg_cron in shared_preload_libraries and a server restart. Every caller checks this first so a migration or a schema dump against a database without cron is a no-op rather than an error.

Instance Method Summary collapse

Instance Method Details

#pg_cron_enabled? ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


20
21
22
# File 'lib/pg_cron/adapters/postgres/connection.rb', line 20

def pg_cron_enabled?
  extension_enabled?("pg_cron")
end