现在 insert 分为两种
- 单条 insert
- 多条 insert
1)单条 insert 如果字段为 nil 仍然拼入字段名,例如: 数据库中不允许为空,但默认值是0
insert…
@Lunny Xiao 我本地这样该的,报错就好了,但不知道这样改是不是最优的
func setColumnTime(bean interface{}, col *schemas.Column, t time.Time) {
v, err :=…
还有一个问题,insert 的时候,能不能通过类型的 Value() 看以下是否为 nil,如果为 nil 就不要拼 insert 的 sql 文了
现在的现象是,使用了类似…
As a workround, you could start a transaction to ensure we are in the master.
@lunny 开启事务后,就在 master 里么,那这就不是 bug 了啊
@lunny 受累看一下能合并了么,之前您说在 ModifyColumnSQL 里,两段 sql 之前应该有已给空格
但是在 commentSQL…
func (db *postgres) ModifyColumnSQL(tableName string, col *schemas.Column) string {
quoter := db.dialect.Quoter()
modifyColumnSQL := ""
commentSQL := "; "
if len(db.getSchema()) == 0…
xorm DATETIME & TIMESTAMP both are mapped to TIMESTAMP in pgsql
but TIMESTAMP in pgsql like mysql's datetime, TIMESTAMP with zone in pgsql like mysql's timestamp
The tag of the model has two…
@lunny has space and semicolon
commentSQL := "; "
commentSQL += "xxxx"
How about also add simliar test cases for postgres?
parser.Parse only set table.Commet, it will be used in dialects
i don't know how to import master branch in my project