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(<<~SQL, [primary_key, column_value])
    INSERT INTO #{table_name} (id, some_column) VALUES ($1, $2)
  SQL

  session.close

  primary_key
end