Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

建议增加 每个映射表struct 里面的 Created 跟 Updated 字段 在插入 修改的时候 自动写入到数据库中 #6

Closed
mrcuix opened this issue Aug 16, 2013 · 0 comments

Comments

@mrcuix
Copy link

mrcuix commented Aug 16, 2013

建议增加 每个映射表struct 里面的 Created 跟 Updated 字段 在插入 修改的时候 自动写入到数据库中

如 实例中:

// add Begin() before any action
err := session.Begin()  
user1 := Userinfo{Username: "xiaoxiao", Departname: "dev", Alias: "lunny", Created: time.Now()}
_, err = session.Insert(&user1)
if err != nil {
    session.Rollback()
    return
}

免去 其中

Created: time.Now()

就很不错了

@lunny lunny closed this as completed in 695b89c Sep 2, 2013
BetaCat0 pushed a commit to BetaCat0/xorm that referenced this issue Jul 31, 2018
Bugfix: do not add a where clause automatically for select
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant