fanybook
  • Joined on 2021-11-04
fanybook commented on issue xorm/xorm#2101 2022-01-14 10:10:51 +00:00
insert 时,字段为 nil 该不该拼入字段名的问题

现在 insert 分为两种

  1. 单条 insert
  2. 多条 insert

1)单条 insert 如果字段为 nil 仍然拼入字段名,例如: 数据库中不允许为空,但默认值是0

insert…

fanybook opened issue xorm/xorm#2101 2022-01-14 09:50:07 +00:00
insert 时,字段为 nil 该不该拼入字段名的问题
fanybook commented on issue xorm/xorm#2099 2022-01-14 09:38:08 +00:00
貌似不支持 sql.NullTime

@Lunny Xiao 我本地这样该的,报错就好了,但不知道这样改是不是最优的

func setColumnTime(bean interface{}, col *schemas.Column, t time.Time) {
	v, err :=
fanybook commented on issue xorm/xorm#2099 2022-01-14 09:24:46 +00:00
貌似不支持 sql.NullTime

还有一个问题,insert 的时候,能不能通过类型的 Value() 看以下是否为 nil,如果为 nil 就不要拼 insert 的 sql 文了

现在的现象是,使用了类似…

fanybook opened issue xorm/xorm#2099 2022-01-14 07:57:52 +00:00
貌似不支持 sql.NullTime
fanybook closed issue xorm/xorm#2072 2021-11-19 02:05:01 +00:00
ForUpdate 的时候,主从是不是该用主
fanybook commented on issue xorm/xorm#2072 2021-11-18 05:32:25 +00:00
ForUpdate 的时候,主从是不是该用主

As a workround, you could start a transaction to ensure we are in the master.

@lunny 开启事务后,就在 master 里么,那这就不是 bug 了啊

fanybook opened issue xorm/xorm#2072 2021-11-18 02:16:38 +00:00
ForUpdate 的时候,主从是不是该用主
fanybook commented on pull request xorm/xorm#2067 2021-11-12 03:32:56 +00:00
add table & column comment for postgres(add table comment for mysql)

@lunny 受累看一下能合并了么,之前您说在 ModifyColumnSQL 里,两段 sql 之前应该有已给空格

但是在 commentSQL…

fanybook commented on pull request xorm/xorm#2067 2021-11-10 15:26:25 +00:00
add table & column comment for postgres(add table comment for mysql)
func (db *postgres) ModifyColumnSQL(tableName string, col *schemas.Column) string {
	quoter := db.dialect.Quoter()
	modifyColumnSQL := ""
	commentSQL := "; "

	if len(db.getSchema()) == 0
fanybook commented on issue xorm/xorm#2069 2021-11-10 08:21:02 +00:00
postgres 下,字段类型的对应关系 TIMESTAMPZ 是否也应该变为 TEXT

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…

fanybook commented on pull request xorm/xorm#2067 2021-11-10 07:28:32 +00:00
add table & column comment for postgres(add table comment for mysql)

@lunny has space and semicolon

commentSQL := "; "
commentSQL += "xxxx"
fanybook opened issue xorm/xorm#2069 2021-11-09 07:20:03 +00:00
postgres 下,字段类型的对应关系 TIMESTAMPZ 是否也应该变为 TEXT
fanybook commented on pull request xorm/xorm#2067 2021-11-09 05:38:42 +00:00
add table & column comment for postgres(add table comment for mysql)

@lunny 看一下,能合并了么

fanybook pushed to master at fanybook/xorm 2021-11-08 09:40:29 +00:00
b46dc622ff fixed test case
fanybook pushed to master at fanybook/xorm 2021-11-08 06:50:17 +00:00
6a1a245c48 remove unnecessary empty line
fanybook pushed to master at fanybook/xorm 2021-11-08 06:14:12 +00:00
e6817a5423 remove unnecessary chinese change
fanybook commented on pull request xorm/xorm#2067 2021-11-08 06:11:12 +00:00
add table & column comment for postgres(add table comment for mysql)

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

fanybook pushed to master at fanybook/xorm 2021-11-08 06:02:38 +00:00
b2e1f1c241 remove unnecessary change
fanybook pushed to master at fanybook/xorm 2021-11-08 05:58:17 +00:00
92b12f29a7 add some test cases