Open jjjachyty opened 6 years ago
This bug still exist, while inserting a type time.Time
@yixin19 can you see my mark //oracle DateTime Bug @ByJanly?
@yixin19 can you see my mark //oracle DateTime Bug @ByJanly?
Yes, you mean that i have to modify the engine.go file. But when i need to switch between databases, it's not easy.
@yixin19 can you see my mark //oracle DateTime Bug @ByJanly?
Yes, you mean that i have to modify the engine.go file. But when i need to switch between databases, it's not easy.
you can switch and case your db drivers or if oracle
@yixin19 can you see my mark //oracle DateTime Bug @ByJanly?
Yes, you mean that i have to modify the engine.go file. But when i need to switch between databases, it's not easy.
you can switch and case your db drivers or if oracle
okay thx
If you use goracle driver, the driver can process time.Time, as the code from @jjjachyty you can directly return t
so that goracle can process it.
If you don't want modify the code from xorm, you can create the *sql.DB and use goracle.NewSessionIniter to reset "NLS_DATE_FORMAT" with "yyyy-mm-dd hh24:mi:ss", then It will works!
engine, err := xorm.NewEngine("goracle", dsn)
ctr, err := goracle.NewConnector(dsn, goracle.NewSessionIniter(map[string]string{
"NLS_DATE_FORMAT": "yyyy-mm-dd hh24:mi:ss",
}))
engine.DB().DB = sql.OpenDB(ctr)
ORA-01861: literal does not match format string ORA-01843: not a valid month\n"
Can be temporary modified
engine.go
1589 line