當前位置: 首頁>>代碼示例>>Golang>>正文


Golang SqlExecutor.Delete方法代碼示例

本文整理匯總了Golang中github.com/coopernurse/gorp.SqlExecutor.Delete方法的典型用法代碼示例。如果您正苦於以下問題:Golang SqlExecutor.Delete方法的具體用法?Golang SqlExecutor.Delete怎麽用?Golang SqlExecutor.Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/coopernurse/gorp.SqlExecutor的用法示例。


在下文中一共展示了SqlExecutor.Delete方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: DeleteBundles

func (app *App) DeleteBundles(txn gorp.SqlExecutor) error {
	bundles, err := app.Bundles(txn)
	if err != nil {
		return err
	}

	args := make([]interface{}, len(bundles))
	for i, bundle := range bundles {
		args[i] = bundle
	}

	_, err = txn.Delete(args...)
	return err
}
開發者ID:kayac,項目名稱:alphawing,代碼行數:14,代碼來源:app.go

示例2: DeleteAuthorities

func (app *App) DeleteAuthorities(txn gorp.SqlExecutor) error {
	authorities, err := app.Authorities(txn)
	if err != nil {
		return err
	}

	args := make([]interface{}, len(authorities))
	for i, authority := range authorities {
		args[i] = authority
	}

	_, err = txn.Delete(args...)
	return err
}
開發者ID:kayac,項目名稱:alphawing,代碼行數:14,代碼來源:app.go

示例3: DeleteIgnoreList

func DeleteIgnoreList(db gorp.SqlExecutor, parms martini.Params) (int, string) {
	id, err := strconv.Atoi(parms["id"])
	obj, _ := db.Get(models.Ignore_List{}, id)
	if err != nil || obj == nil {
		checkErr(err, "get failed")
		// Invalid id, or does not exist
		return http.StatusBadRequest, ""
	}
	entity := obj.(*models.Ignore_List)
	_, err = db.Delete(entity)
	if err != nil {
		checkErr(err, "delete failed")
		return http.StatusBadRequest, ""
	}
	return http.StatusOK, ""
}
開發者ID:gitter-badger,項目名稱:warnabroda-server,代碼行數:16,代碼來源:ignore_list.go

示例4: DeleteContact_type

func DeleteContact_type(db gorp.SqlExecutor, parms martini.Params) (int, string) {
	id, err := strconv.Atoi(parms["id"])
	obj, _ := db.Get(models.DefaultStruct{}, id)
	if err != nil || obj == nil {
		checkErr(err, "GET CONTACT TYPE FAILED")
		// Invalid id, or does not exist
		return http.StatusBadRequest, ""
	}
	entity := obj.(*models.DefaultStruct)
	_, err = db.Delete(entity)
	if err != nil {
		checkErr(err, "DELETE CONTACT TYPE FAILED")
		return http.StatusConflict, ""
	}
	return http.StatusBadRequest, ""
}
開發者ID:gitter-badger,項目名稱:warnabroda-server,代碼行數:16,代碼來源:contact_types.go

示例5: DeleteFromDB

func (app *App) DeleteFromDB(txn gorp.SqlExecutor) error {
	_, err := txn.Delete(app)
	return err
}
開發者ID:kayac,項目名稱:alphawing,代碼行數:4,代碼來源:app.go

示例6: DeleteFromDB

func (bundle *Bundle) DeleteFromDB(txn gorp.SqlExecutor) error {
	_, err := txn.Delete(bundle)
	return err
}
開發者ID:kayac,項目名稱:alphawing,代碼行數:4,代碼來源:bundle.go

示例7: Delete

func (user *User) Delete(txn gorp.SqlExecutor) error {
	_, err := txn.Delete(user)
	return err
}
開發者ID:kayac,項目名稱:alphawing,代碼行數:4,代碼來源:user.go

示例8: DeleteFromDB

func (authority *Authority) DeleteFromDB(txn gorp.SqlExecutor) error {
	_, err := txn.Delete(authority)
	return err
}
開發者ID:kayac,項目名稱:alphawing,代碼行數:4,代碼來源:authority.go

示例9: Delete

func (audit *Audit) Delete(txn gorp.SqlExecutor) error {
	_, err := txn.Delete(audit)
	return err
}
開發者ID:kayac,項目名稱:alphawing,代碼行數:4,代碼來源:audit.go


注:本文中的github.com/coopernurse/gorp.SqlExecutor.Delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。