📜  在 ruby 代码示例中更新数据库

📅  最后修改于: 2022-03-11 15:04:47.845000             🧑  作者: Mango

代码示例1
def update
    sql = <<-SQL
    UPDATE dogs SET name = ?, breed = ? WHERE id = ?
    SQL

    DB[:conn].execute(sql, self.name, self.breed, self.id)
  end