自定义主键Id()的调用 #51
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#51
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
在表未定义主键之前这个代码是会通过id去更新数据的
eft, err := db.Id(id).Update(a)
在自定义主键后表结构如下
type Article struct {
Id int32
pk INT autoincr
Name string
xorm:"VARCHAR(45)"
Img string
xorm:"VARCHAR(100)"
Aside string
XORM:"VARCHAR(200)"
Desc string
XORM:"VARCHAR(200)"
Content string
XORM:"TEXT"
Status int8
xorm:"TINYINT(4)"
}
eft, err := db.Id(id).Update(a)中Id(id)是无效的