📜  删除行 pgx - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:59.059000             🧑  作者: Mango

代码示例1
commandTag, err := conn.Exec(context.Background(), "delete from widgets where id=$1", 42)
if err != nil {
    return err
}
if commandTag.RowsAffected() != 1 {
    return errors.New("No row found to delete")
}