Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record save will auto rollback #665

Open
wzhsh90 opened this issue Jul 23, 2022 · 0 comments
Open

record save will auto rollback #665

wzhsh90 opened this issue Jul 23, 2022 · 0 comments

Comments

@wzhsh90
Copy link

wzhsh90 commented Jul 23, 2022

image
type Company struct {
Id string db:"id" form:"id" json:"id"
ComDesc string db:"com_desc" form:"com_desc" json:"com_desc"
ComName string db:"com_name" form:"com_name" json:"com_name"
}
func (b *Company) Store(sess db.Session) db.Store {
return sess.Collection("sys_company_t")
}

this is my model , i use .Save(record) method , the log show insert success , but the database is none.

Transaction ID: 00004
Query: INSERT INTO sys_company_t (com_desc, com_name, id) VALUES (?, ?, ?)
Arguments: []interface {}{"1", "1", "62dbd5f15320e7a9b0318a9a"}
Rows affected: 1
Last insert ID: 0
Time taken: 0.00063s
Context: context.Background

the reason is
image

InsertReturning throw the error
"upper: no more rows in this result set"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant