Method: Sequel::Postgres::DatabaseMethods#do

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

#do(code, opts = OPTS) ⇒ Object

Use PostgreSQL’s DO syntax to execute an anonymous code block. The code should be the literal code string to use in the underlying procedural language. Options:

:language

The procedural language the code is written in. The PostgreSQL default is plpgsql. Can be specified as a string or a symbol.



241
242
243
244
# File 'lib/sequel/adapters/shared/postgres.rb', line 241

def do(code, opts=OPTS)
  language = opts[:language]
  run "DO #{"LANGUAGE #{literal(language.to_s)} " if language}#{literal(code)}"
end