module ODBA class Storage def add_object_connection(origin_id, target_id) #SELECT sql = <<-SQL SELECT COUNT(origin_id) FROM object_connection WHERE origin_id = ? AND target_id = ? SQL rows = @dbi.select_all(sql, origin_id, target_id) if(rows.first.first == 0) #INSERT sth = @dbi.prepare <<-SQL INSERT INTO object_connection(origin_id, target_id) VALUES (?,?) SQL sth.execute(origin_id, target_id) end end end end