db
db copied to clipboard
Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
Signed-off-by: Abirdcfly
Hi, We're building an API using `net/http` (server) and `github.com/gorilla/mux` (router) and have some difficulties understanding how to best manage open connections in an efficient way using `upper/db` for `mysql`....
type Company struct { Id string `db:"id" form:"id" json:"id"` ComDesc string `db:"com_desc,omitempty" form:"com_desc" json:"com_desc"` ComName string `db:"com_name" form:"com_name" json:"com_name"` } i use the omitempty tag ,that is not work
I have a query in this form ``` SELECT ... FROM ... JOIN (SELECT ... FROM ... WHERE ... IN ? ) .... ``` I've tried running it with `Query(argSlice)`...
Provide a way to disable logging. Also as a workaround for https://github.com/upper/db/issues/599
In the [SQLite adapter's StatementExec method](https://github.com/upper/db/blob/master/adapter/sqlite/database.go#L79-L92), the opened transaction doesn't get rolled back if `compat.ExecContext` returns an error. This came up in a personal project after hitting a constraint violation...
the result can to trans to map[string]interface var list []map[string]interface{} p.Page(pageIndex).All(&list) info := map[string]interface{}{} Find(cond).Select(cols...).One(&info) the result interface {} is []uint8
the sql Paginate does not contains Count method
 type Company struct { Id string `db:"id" form:"id" json:"id"` ComDesc string `db:"com_desc" form:"com_desc" json:"com_desc"` ComName string `db:"com_name" form:"com_name" json:"com_name"` } func (b *Company) Store(sess db.Session) db.Store { return sess.Collection("sys_company_t")...