Commit Graph

46 Commits

Author SHA1 Message Date
Lunny Xiao 4cde28ca21 Use any instead of interface{} (#2360)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2360
2023-10-28 10:59:32 +00:00
Lunny Xiao af9edecff1 Move core internal (#2354)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2354
2023-10-27 16:27:33 +00:00
Lunny Xiao 82faf6c301 start v2 (#2350)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2350
2023-10-27 14:27:46 +00:00
Lunny Xiao 4109ce1e23 Fix a serious bug when using rows and reuse the session (#2309)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2309
2023-07-25 08:37:12 +00:00
洪坤安 73eee961cc Performance Optimization: reduce slice2Bean calling times of strings.ToLower and map creation times (#2255)
1. 优化性能:减少func (session *Session) slice2Bean方法中的strings.ToLower调用次数以及减少map创建和访问次数(见工单 https://gitea.com/xorm/xorm/issues/2243)

2. 新增SetDefaultJSONHandler方法,用于用户自行设置DefaultJSONHandler(见工单 https://gitea.com/xorm/xorm/issues/2129)

优化前:
加载耗时=16.079s,总记录数=4028940
加载耗时=15.775s,总记录数=4028940
加载耗时=15.946s,总记录数=4028940

优化后:
加载耗时=10.863s,总记录数=4028940
加载耗时=11.257s,总记录数=4028940
加载耗时=11.155s,总记录数=4028940

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2255
Co-authored-by: 洪坤安 <wuzili1234@163.com>
Co-committed-by: 洪坤安 <wuzili1234@163.com>
2023-07-12 09:53:19 +00:00
Lunny Xiao 79a8bc804b Fix join problem (#2291)
Fix #2284

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2291
2023-07-12 02:01:56 +00:00
Lunny Xiao a2d3669edf Add README and fix some lints (#2079)
as title.

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2079
2021-12-14 09:00:35 +08:00
Lunny Xiao 4656a87f2f Fix bug (#2046)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2046
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-09-13 15:19:59 +08:00
daisuzu 78309606d4 fix panic when `Iterate()` fails (#2040)
not to call `rows.Err()`

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2040
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: daisuzu <daisuzu@noreply.gitea.io>
Co-committed-by: daisuzu <daisuzu@noreply.gitea.io>
2021-09-07 09:23:16 +08:00
Lunny Xiao d92fb412ee Make Get and Rows.Scan accept multiple parameters (#2029)
Now the below behaviours are allowed.

```Go
var id int64
var name string
has, err := engine.Table(&user).Cols("id", "name").Get(&id, &name)
// SELECT id, name FROM user LIMIT 1
```

```Go
rows, err := engine.Cols("name", "age").Rows(&User{Name:name})
// SELECT * FROM user
defer rows.Close()
for rows.Next() {
    var name string
    var age int
    err = rows.Scan(&name, &age)
}
```

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2029
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-08-24 15:42:34 +08:00
Lunny Xiao a7e010df2d refactor insert condition generation (#1998)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1998
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-20 13:46:24 +08:00
Lunny Xiao aaa2111e8f Refactor asbytes (#1995)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1995
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-19 00:21:46 +08:00
Lunny Xiao 3617ee736f Only replace quotes when necessary (#1584)
fix test

improve code

improve code

improve code

improve code

Fix replace quote

fix test

Only replace quotes when necessary

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1584
2020-03-09 02:17:37 +00:00
Lunny Xiao 0f166d82da Fix rows bug (#1576)
Fix rows bug

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1576
2020-03-06 12:08:32 +00:00
Lunny Xiao 2b62dc5a51 Move statement as a sub package (#1564)
Fix test

Fix bug

Move statement as a sub package

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1564
2020-02-28 12:29:08 +00:00
Lunny Xiao bf25a77bca Merge core package back into the main repository and split into serval sub packages. (#1543)
Fix test

Improve fmt

update go.mod

Move core as a sub package

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1543
2020-02-24 08:53:18 +00:00
Lunny Xiao f1b4f83684
fix no rows return error when close (#1334) 2019-06-20 23:12:08 +08:00
Lunny Xiao c9b14f9487
move depends package from github.com to customize domain (#1327) 2019-06-17 13:38:13 +08:00
Lunny Xiao e1f788fb7e
remove unused_code (#1200) 2019-01-20 19:54:43 +08:00
Lunny Xiao bd20c37bfb
Add SetSchema for engine (#876)
* add SetSchema for engine

* fix user

* fix postgres with schema

* fix test

* fix test

* fix test

* fix tablename

* refactor tableName

* fix schema support

* improve the interface of EngineInterface
2018-04-10 09:50:29 +08:00
Lunny Xiao 29d4a0330a improve processors (#743) 2017-09-30 09:26:13 +08:00
Lunny Xiao bb639f6700 refactor query functions (#689)
* refactor query functions

* remove unused function

* remove unnecessary resetStatement and some improvements

* rename all Id to ID
2017-08-27 15:50:43 +08:00
Lunny Xiao f1aebd5729 hide all undocument variables on session (#660) 2017-07-27 13:32:35 +08:00
Lunny Xiao 32d688fd96 close rows if possible (#629) 2017-06-25 17:35:04 +08:00
Lunny Xiao 1e055bac01 fix bug and catch more tests (#613) 2017-06-08 19:38:52 +08:00
Lunny Xiao aae045f9aa
fix #563 2017-04-10 19:45:00 +08:00
Lunny Xiao d170089adf
refactor rowsbean 2017-03-14 23:03:27 +08:00
Lunny Xiao 2b462f7180
remove unused field of rows 2017-03-01 16:38:15 +08:00
Lunny Xiao 1bc93ba022
bug fixed for BeforeSet and AfterSet on Find a Map 2017-02-20 17:51:59 +08:00
Lunny Xiao cd5244ee2c bug fixed for log 2016-09-29 22:10:55 +08:00
Lunny Xiao c9b09da6e1 rename 2016-09-19 11:13:40 +08:00
Lunny Xiao ea9a4495ac golint and comments 2016-07-11 11:29:34 +08:00
Lunny Xiao b8b1711cde resolved gogits/gogs#3251 2016-07-11 07:21:12 +08:00
Lunny Xiao 811443400f resolved #389 2016-07-09 11:36:23 +08:00
Lunny Xiao 5612916fea bug fixed and performance improved for table name 2016-07-09 08:15:53 +08:00
evalphobia ebd11048f3 Added feature for storing lastSQL query on session 2015-07-28 13:03:20 +09:00
Lunny Xiao 1992491553 license 2015-04-28 16:25:04 +08:00
Lunny Xiao 0cfd60f101 use DB() instead newDb() 2015-02-25 15:26:52 +08:00
Nash Tsai 0491cec2e6 changed to cache and nocache tag value support
public Engine.TableInfo() API
2014-08-29 00:34:09 +08:00
Lunny Xiao feb1f45e72 Added NewDB(), DB(), Clone() and removed pool object and other improvements 2014-04-15 11:39:29 +08:00
Lunny Xiao 5080b2b571 Merge branch 'master' into dev
Conflicts:
	dialects/oracle.go
	dialects/postgres.go
	docs/QuickStart.md
	engine.go
	mysql.go
	session.go
	statement.go
	table.go
	tests/base_test.go
	xorm.go
	xorm/go.go
	xorm/reverse.go
2014-04-11 15:37:27 +08:00
Nash Tsai 4f6106e168 private Engine.LogSQL and create ILogger interface that is compatible with log/syslog package. Also fixed use of LogError instead of LogSQL 2014-02-12 01:35:26 +08:00
Lunny Xiao b66e7aa067 use core.DB instead of sql.DB 2014-02-11 14:59:04 +08:00
Lunny Xiao 4df43ffa0f new architecture 2014-01-07 17:33:27 +08:00
Nash Tsai 7bbabe72f0 add Session.row2Bean 2013-12-27 02:14:30 +08:00
Nash Tsai 6bc64c8fe6 change Iterator struct naming to 'Rows' and making compatible interface to sql.Rows 2013-12-26 14:50:44 +08:00