Method: Sequel::Postgres::StaticCacheUpdater#create_static_cache_update_function
- Defined in:
- lib/sequel/extensions/pg_static_cache_updater.rb
permalink #create_static_cache_update_function(opts = OPTS) ⇒ Object
Add the static cache update function to the PostgreSQL database. This must be added before any triggers using this function are added.
Options:
- :channel_name
-
Override the channel name to use.
- :function_name
-
Override the function name to use.
80 81 82 83 84 85 86 87 |
# File 'lib/sequel/extensions/pg_static_cache_updater.rb', line 80 def create_static_cache_update_function(opts=OPTS) create_function(opts[:function_name]||default_static_cache_update_name, "BEGIN\n PERFORM pg_notify(\#{literal((opts[:channel_name]||default_static_cache_update_name).to_s)}, TG_RELID::text);\n RETURN NULL;\nEND\n", :returns=>:trigger, :language=>:plpgsql) end |