Module: Sqlbuilder::Statements::Builders::Postgres::InsertBuilder
- Includes:
- InsertBuilder
- Defined in:
- lib/sqlbuilder/statements/builders/postgres/insert_builder.rb
Instance Method Summary
collapse
#build_columns, #build_into, #build_values
Instance Method Details
#build_on_conflict ⇒ Object
10
11
12
|
# File 'lib/sqlbuilder/statements/builders/postgres/insert_builder.rb', line 10
def build_on_conflict
"ON CONFLICT (#{@conflict_target.join(',')})"
end
|
#build_update ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/sqlbuilder/statements/builders/postgres/insert_builder.rb', line 14
def build_update
set_list = @values_to_update.map do |key, value|
"#{key} = #{@utils.format_value(value)}"
end
"DO UPDATE SET #{set_list.join(", ")}"
end
|