Method: Sequel::Postgres::DatabaseMethods#notify

Defined in:
lib/sequel/adapters/shared/postgres.rb

#notify(channel, opts = OPTS) ⇒ Object

Notifies the given channel. See the PostgreSQL NOTIFY documentation. Options:

:payload

The payload string to use for the NOTIFY statement. Only supported in PostgreSQL 9.0+.

:server

The server to which to send the NOTIFY statement, if the sharding support is being used.



375
376
377
378
379
380
381
382
383
# File 'lib/sequel/adapters/shared/postgres.rb', line 375

def notify(channel, opts=OPTS)
  sql = "NOTIFY "
  dataset.send(:identifier_append, sql, channel)
  if payload = opts[:payload]
    sql << ", "
    dataset.literal_append(sql, payload.to_s)
  end
  execute_ddl(sql, opts)
end