go-xorm / core Goto Github PK
View Code? Open in Web Editor NEWLightweight & Compitable wrapper of database/sql, move to https://gitea.com/xorm/core
License: BSD 3-Clause "New" or "Revised" License
Lightweight & Compitable wrapper of database/sql, move to https://gitea.com/xorm/core
License: BSD 3-Clause "New" or "Revised" License
Hello,
I am getting the following test failures:
=== RUN TestExecMap
-- {1 xlw tester 1.2 lunny lunny xiao {0 0 <nil>}}
--- FAIL: TestExecMap (0.13s)
db_test.go:580: sql: Scan error on column index 6: unsupported driver -> Scan pair: time.Time -> *core.NullTime
=== RUN TestExecStruct
1-- {1 xlw tester 1.2 lunny lunny xiao {0 0 <nil>}}
--- FAIL: TestExecStruct (0.13s)
db_test.go:622: sql: Scan error on column index 6: unsupported driver -> Scan pair: time.Time -> *core.NullTime
any idea how to fix this?
Thanks
after execute go test -v -bench=.
, got this error message.
goos: darwin
goarch: amd64
pkg: github.com/go-xorm/core
BenchmarkOriQuery-8 1000 1266147 ns/op
BenchmarkStructQuery-8 1000 1921657 ns/op
BenchmarkStruct2Query-8 500 2829271 ns/op
panic: interface conversion: interface {} is []uint8, not *string
goroutine 2903 [running]:
github.com/go-xorm/core.BenchmarkSliceInterfaceQuery(0xc42055b980)
/Users/carllhw/Projects/go/src/github.com/go-xorm/core/db_test.go:232 +0x7b2
testing.(*B).runN(0xc42055b980, 0x1)
/usr/local/Cellar/go/1.10.2/libexec/src/testing/benchmark.go:141 +0xb2
testing.(*B).run1.func1(0xc42055b980)
/usr/local/Cellar/go/1.10.2/libexec/src/testing/benchmark.go:214 +0x5a
created by testing.(*B).run1
/usr/local/Cellar/go/1.10.2/libexec/src/testing/benchmark.go:207 +0x80
exit status 2
FAIL github.com/go-xorm/core 5.919s
need the method to check whether the database exists!
In oracle database, when default keyword in the last position at xorm tag in table struct, error will happened.
Oracle database error message return: create table error: ORA-00907: missing right parenthesis
Hello,
There is no rush, as we have already uploaded xorm and core to Debian, but it would help us if you tagged xorm and core so that they build together. I have ran into the issue that the last xorm tag did not build with the tip of core.
func ReflectNew(typ reflect.Type) reflect.Value {
reflectCacheMutex.RLock()
cs, ok := reflectCache[typ]
reflectCacheMutex.RUnlock()
const newSize = 200
if !ok || cs.idx+1 > newSize-1 {
cs = &cacheStruct{reflect.MakeSlice(reflect.SliceOf(typ), newSize, newSize), 0}
reflectCacheMutex.Lock()
reflectCache[typ] = cs
reflectCacheMutex.Unlock()
} else {
reflectCacheMutex.Lock()
cs.idx = cs.idx + 1
reflectCacheMutex.Unlock()
}
//todo 当大数据量时,并发多个请求出现out of range错误
return cs.value.Index(cs.idx).Addr()
}
Hello!
I would like to package go-xorm/core for Debian
However, I cound not find a license.
Can you please add one?
sql=delete from t1 where id=?id delete from t2 where id=?id
QueryMap(sql,[id]value)
but sql change to
' delete from t1 where id=value
delete from t2 where id=?
'
does xorm support golang big.Rat to mysql decimal? or like json package, provide a interface which
user can customize type mapping between mysql and golang?
Please consider add YEAR type, thanks.
This package is extremely helpful when you want to simplify sql usage in your app without requiring the fullness of xorm so thank you for writing it.
One thing that would make this library a lot more useful is a new func on core.DB
, It should allow users to specify the table and provide the struct and automatically generate the required sql for it.
For example
user = User{
Name:"lunny",
Title:"test",
Age: 18,
}
result, err = db.ExecStruct("insert into user (`name`, title, age, alias, nick_name,created) values (?Name,?Title,?Age,?Alias,?NickName,?Created)",
&user)
would become
user = User{
Name:"lunny",
Title:"test",
Age: 18,
}
result, err = db.InsertStruct("user", &user)
What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.