1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Retry create issue to cope with duplicate keys (#7898)

* Retry create issue to cope with duplicate keys

* Use  .SetExpr().Where().Insert()
This commit is contained in:
guillep2k
2019-08-26 23:17:23 -03:00
committed by techknowlogick
parent 541fab196f
commit 5fe2ec264f
39 changed files with 1991 additions and 1404 deletions

4
vendor/xorm.io/core/db.go generated vendored
View File

@@ -15,6 +15,7 @@ import (
)
var (
// DefaultCacheSize sets the default cache size
DefaultCacheSize = 200
)
@@ -132,6 +133,7 @@ func (db *DB) Query(query string, args ...interface{}) (*Rows, error) {
return db.QueryContext(context.Background(), query, args...)
}
// QueryMapContext executes query with parameters via map and context
func (db *DB) QueryMapContext(ctx context.Context, query string, mp interface{}) (*Rows, error) {
query, args, err := MapToSlice(query, mp)
if err != nil {
@@ -140,6 +142,7 @@ func (db *DB) QueryMapContext(ctx context.Context, query string, mp interface{})
return db.QueryContext(ctx, query, args...)
}
// QueryMap executes query with parameters via map
func (db *DB) QueryMap(query string, mp interface{}) (*Rows, error) {
return db.QueryMapContext(context.Background(), query, mp)
}
@@ -196,6 +199,7 @@ var (
re = regexp.MustCompile(`[?](\w+)`)
)
// ExecMapContext exec map with context.Context
// insert into (name) values (?)
// insert into (name) values (?name)
func (db *DB) ExecMapContext(ctx context.Context, query string, mp interface{}) (sql.Result, error) {