Module: ViewData::PG::Controls::Row::Put

Defined in:
lib/view_data/pg/controls/row/put.rb

Defined Under Namespace

Modules: CompositePrimaryKey

Class Method Summary collapse

Class Method Details

.callObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/view_data/pg/controls/row/put.rb', line 6

def self.call
  primary_key = PrimaryKey::UUID.example
  column_value = Controls::Data.column_value
  table_name = Table.name

  session = Session.build

  session.execute("    INSERT INTO \#{table_name} (id, some_column) VALUES ($1, $2)\n  SQL\n\n  session.close\n\n  primary_key\nend\n", [primary_key, column_value])