当前位置: 首页>>代码示例>>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;未经允许,请勿转载。