Delete

Delete a row from the database.

This type is used in the examples on this page.

type User struct {
    ID       int `gosql:"primary"`
    Email    string
    IsActive bool
}

Once you have a value, you can delete it from the database.

var user User
db.Select("*").Get(&user)
db.Delete(&user)

Your value must have the primary key set (ie, not the zero value).

Last updated