Commit Graph

255 Commits

Author SHA1 Message Date
Lunny Xiao 7bf9a7a73c Improve statement (#1555)
Fix test

Improve statement

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1555
2020-02-27 05:49:43 +00:00
Lunny Xiao e2f9100419 Move tag parser related codes as a standalone sub package (#1547)
Fix sliceEq

fix tests

Move tag parser related codes as a standalone sub package

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1547
2020-02-27 03:58:31 +00:00
Lunny Xiao a421331cf9 Improve some codes (#1551)
Improve code

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1551
2020-02-27 01:30:06 +00:00
Lunny Xiao 5a5375a170 Improve statement (#1549)
Fix cache bug

Improve statement

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1549
2020-02-27 00:34:16 +00:00
Lunny Xiao 390effb8a4 Move zero functions to a standalone package (#1548)
Remove depreciated functions and move some functions to schemas

Move zero functions to a standalone package

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1548
2020-02-26 12:45:10 +00:00
Lunny Xiao cc33b2d305 Fix join table name quote bug (#1534)
Fix test

Fix test

Add new Quoter object to handle quote

Fix join table name quote bug

Move reserve words related files into dialects sub package (#1544)

Move reserve words related files into dialects sub package

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1544

Fix mssql quote (#1535)

Fix some quotes

Fix mssql quote

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

Fix int time deleted bug (#1539)

Fix panic

Fix test

Fix test for mssql time

Add sql type check on deleted cond

Fix int time deleted bug

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1539

Add test for mysql8.0 (#1538)

Fix pk order on test

Add test for mysql8.0

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1538

Add test for join limit (#1536)

Add test for join limit

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1536

Improve drone (#1537)

Fix drone

Improve drone

* use traditional positional parameters on inser...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1537

Fix slice of struct not cache bug (#895)

Fix failure caused by nil bean

Judge both type of struct and pointer in case of out-of-range

Fix issue #894

Add test for join subquery (#1528)

Fix test

Fix subquery with schema

Add test for join subquery

Add makefile (#1531)

Fix drone

Fix ci

Add deps

Improve drone

Fix envs

Add makefile

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1531

Add password for postgres drone image (#1530)

Add password for postgres drone image

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1530

format time when sqlTypeName is core.Varchar (#1026)

fix time test

add test for time format

sign codes according to contributing rules.

format time when sqlTypeName is core.Varchar. Same with core.DateTime or core.TimeStamp

Add test for second insert error (#1527)

Add test for second insert error

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1527

Add tests for table name (#1517)

add tests for table name

Fix test (#1526)

Fix test

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1526

Fix test (#1526)

Fix test

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1526

Fix wrong warning log on autoincrement column when sync table (#1525)

improve doc

Fix wrong warning log on autoincrement column when sync table

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1525

Fixed Join strings on func Exist (#1520)

fix test

fixed Join strings on func Exist

Co-authored-by: Tomofumi Kusana <tkusana@morisawa.co.jp>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1520

For nullable columns, store nil values as NULL (#531)

Merge branch 'master' into jcsalem/fix/nil_ptr_is_nullable

fix bug when buffersize with iterate (#941)

Merge branch 'master' into lunny/fix_buffer_iterate

Exclude schema from index name (#1505)

Merge branch 'master' into fix-schema-idx

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Exclude schema from the index name

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1505

fix test

fix bug

fix bug when buffersize with iterate

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Fix update with Alias (#1455)

Co-authored-by: Guillermo Prandi <guillep2k@noreply.gitea.io>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/941

fix update map with version (#1448)

fix test

fix update map with version

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Fix update with Alias (#1455)

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1448

Exclude schema from index name (#1505)

Merge branch 'master' into fix-schema-idx

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Exclude schema from the index name

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1505

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

For nullable columns, store nil values as NULL

fix vet

fix drone lint

remove go1.10 test on drone

Fix update with Alias (#1455)

Improve c...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1534
2020-02-25 00:01:36 +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 43b364ccfd Allow update created field if indicated on Cols (#1513)
Allow update created field if indicated on Cols

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1513
2020-01-20 08:23:54 +00:00
Lunny Xiao 6dfe337869 fix statement.LimitN(0) will delete or update all data (#1119)
fix test

fix nil pointer

fix statement.Limit(0) will update or delete all data

fix bug when buffersize with iterate (#941)

Merge branch 'master' into lunny/fix_buffer_iterate

Exclude schema from index name (#1505)

Merge branch 'master' into fix-schema-idx

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Exclude schema from the index name

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1505

fix test

fix bug

fix bug when buffersize with iterate

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Fix update with Alias (#1455)

Co-authored-by: Guillermo Prandi <guillep2k@noreply.gitea.io>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/941

fix update map with version (#1448)

fix test

fix update map with version

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Fix update with Alias (#1455)

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1448

Exclude schema from index name (#1505)

Merge branch 'master' into fix-schema-idx

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Exclude schema from the index name

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1505

SetExpr support more go types (#1499)

Improve tests

SetExpr support more go types

fix vet

fix drone lint

remove go1.10 test on drone

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1499

fix vet

fix drone lint

remove go1.10 test on drone

Fix update with Alias (#1455)

Improve ci tests (#1477)

Rewrite Engine.QuoteTo() to accept multi-part identifiers (#1476)

Support local sql log (#1338)

Fix go mod and update version (#1460)

Move github.com/go-xorm/xorm to xorm.io/xorm (#1459)

add support custom type Nullfloat64 (#1450)

fix bug when query map condtion with no quote (#1449)

Don't warn when bool column default is 1 but not true (#1447)

* don't warn when bool column default is 1 but not true

* fix default case sensitive

Fix sync2 with custom table name (#1445)

* fix sync2 with custom table name

* fix bug on postgres

* fix bug on postgres

fix bug when update with setexpr (#1446)

add tidb tests on drone ci (#1444)

improve sync2 (#1443)

Fix wrong dbmetas (#1442)

* add tests for db metas

* add more tests

* fix bug on mssql

Fix default value parse bugs (#1437)

* fix default value

* fix default value tags

* fix postgres default

* fix default on postgres

* fix default on postgres

* fix mssql default

fix arg conversion (#1441)

* fix arg conversion

* fix bugs

* fix bug on postgres

* use traditional positional parameters on insert into select

* remove unnecessary tests

upgrade core (#1440)

add tests (#1439)

add go1.13 tests on drone (#1416)

Fix bug on insert where (#1436)

* fix bug on insert where

* fix bug

* fix lint

fix bug when insert multiple slices with customize table name (#1433)

* fix bug when insert multiple slices with customize table name

* fix tests on mssql

* fix tests

fix insert where with bool bug on mssql (#1432)

fix setexpr missing big quotes (#1431)

* fix setexpr missing big quotes

* fix tests

* fix tests

Add support subquery on SetExpr (#1428)

* add support subquery on SetExpr

* fix tests

fix go mod (#1427)

fix tests (#1429)

Use strings.Builder instead of builder.StringBuilder (#1417)

* use strings.Builder instead of builder.StringBuilder

* fix dependency

* fix dependency

Remove unuse get cols code (#1413)

Add mssql ci test (#1410)

* add mssql ci test

* fix drone test

Add insert select where support (#1401)

Use drone new format (#1388)

* use drone new format
fix get customize type bug (#1382)

fix bugs (#1375)

update drone (#1374)

Add tests for get var (#1305)

* add test for SQL get
* fix tests

fix error when get null var (#890)

* fix error when get null var
* add support get for null var
* fix bug

Remove quotestr totally (#1366)

* remove QuoteStr() totally

* update xorm.core -> v0.7.0

* update dialect Quote

remove QuoteStr() usage in dialects (#1364)

document of FindAndCount() (#1365)

remove QuoteStr() usage (#1360)

Co-authored-by: yifhao <yifhao@tencent.com>
Co-authored-by: yifhao <1124210681@qq.com>
Co-authored-by: Guillermo Prandi <guillep2k@noreply.gitea.io>
Co-authored-by: Guillermo Prandi <guillep2k@noreply@gitea.io>
Co-authored-by: yudppp <yu.d.ppp@gmail.com>
Co-authored-by: BetaCat <outman99@hotmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1119
2020-01-20 08:22:06 +00:00
Lunny Xiao 57a49c6c23
fix bug when query map condtion with no quote (#1449) 2019-10-05 14:36:18 +08:00
Lunny Xiao da95db5ddc
fix bug when update with setexpr (#1446) 2019-10-02 08:14:48 +08:00
Lunny Xiao 6d11913765
Add support subquery on SetExpr (#1428)
* add support subquery on SetExpr

* fix tests
2019-09-23 23:34:26 +08:00
Lunny Xiao 57a7e4421e
Use strings.Builder instead of builder.StringBuilder (#1417)
* use strings.Builder instead of builder.StringBuilder

* fix dependency

* fix dependency
2019-09-06 22:15:04 +08:00
BetaCat 18b32486cf remove QuoteStr() usage (#1360) 2019-07-24 09:41:06 +08:00
Cheng Lu 62d884e8f1 use alias 'as.*' in oracle query with join (#1355) 2019-07-16 09:21:31 +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 5ef12eab78
make json as interface (#1248) 2019-03-29 14:32:36 +08:00
Lunny Xiao 17b9cc7330
Add mssql ci test (#1203)
* add mssql ci test

* fix mssql ci

* check test databases

* fix ci

* fix postgres schema tests

* fix ci on postgres

* fix insert map bug

* fix insert map bug

* fix bug

* fix insert map bug

* fix create schema on tests

* fix mssql tests

* fix insert return id bugs on mssql

* add head comments
2019-01-22 23:59:58 +08:00
Lunny Xiao 731b056a56
Join support builder (#1002)
* join support builder

* add tests

* fix tests

* fix tests

* fix join sub query
2019-01-20 11:53:53 +08:00
Lunny Xiao c68531db53
Add lasterror on statement to return errors when chain operations (#1151)
* add lasterror on statement to return errors when chain operations

* add tests for last error

* refactor error
2019-01-20 11:45:42 +08:00
Lunny Xiao 7a9249de33
Get adds context cache feature (#1102)
* context

* add context cache feature

* remove global context cache

* remove global context cache

* reset statment

* fix bug

* remove unused params

* refactor ContextCache

* refactor ContextCache

* update README

* update README

* disable global cache on context cache test
2018-09-25 21:31:44 +08:00
Lunny Xiao 1eee8a367e
fix #997 group by (#1065) 2018-08-09 14:37:44 +08:00
Lunny Xiao ad69f7d8f0
performance improvement via string builder (#1036) 2018-07-11 08:59:00 +08:00
DrWrong(Yuhang) f16ce722ec Fix BUG: Update statement build function should ingore ONLYFROMDB fields (#1012)
* Fix BUG: Update statement build function should ingore ONLYFROMDB fields

* Add test case

* Modify test case
2018-06-23 14:59:01 +08:00
Lunny Xiao 0f339654dd
fix cols and distinct conflicts (#927) 2018-05-04 13:09:54 +08:00
Lunny Xiao 636ccefbc7
fix update map with table name (#888)
* fix update map with table name

* fix bug update map when cache enabled

* refactor cacheInsert

* fix cache test
2018-04-11 23:09:46 +08:00
Lunny Xiao bfdf773629
fix tablename bug (#887)
* fix tablename bug

* fix test
2018-04-11 18:09:16 +08:00
Lunny Xiao 6542364944
refactor buildUpdates (#884) 2018-04-11 12:57:13 +08:00
Lunny Xiao fd4a80bcad
fix id condition not used bug (#882) 2018-04-11 11:52:16 +08:00
Lunny Xiao 590c04df2d
Add test for count with orderby and limit (#880)
* add test for count with orderby and limit

* fix the bug
2018-04-10 12:52:47 +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 9242b921d8
Join add TableName interface support (#874)
* Join add TableName interface support

* add some tests

* Join add struct support

* more tests
2018-04-08 21:54:24 +08:00
Lunny Xiao cea778734c
fix FindAndCount bug with Limit (#851) 2018-02-22 20:24:40 -06:00
mzmuer 936cca7c69 mysql add column comment (#783) 2017-11-20 15:20:28 +08:00
Lunny Xiao 865979f716
add support for map[string]interface{} as condition on Update and Where (#764) 2017-10-30 11:07:56 +08:00
Lunny Xiao c9690500fa add buffer Iterate support (#729) 2017-09-19 20:59:41 +08:00
Lunny Xiao 265dd66928 fix bug on cache delete (#703)
* fix bug on cache delete

* fix cache issues and improve the tests
2017-09-09 11:03:34 +08:00
Lunny Xiao 0fdfa8d8de fix bug on update (#676) 2017-08-05 10:46:29 +08:00
Lunny Xiao fbf37fc795 improve count usage (#654) 2017-07-25 16:50:20 +08:00
Lunny Xiao dbc493df5e multiple Cols support (#653) 2017-07-24 22:09:47 +08:00
Lunny Xiao 8cfde0eb4b fix Conds bug on Find and add test for FindAndCount (#652) 2017-07-24 21:26:14 +08:00
Lunny Xiao 2af18acf72 add CondDeleted method (#620) 2017-06-15 20:09:46 +08:00
Lunny Xiao 1e055bac01 fix bug and catch more tests (#613) 2017-06-08 19:38:52 +08:00
Lunny Xiao 942887dea0 fix time issues and add some tests for time (#604)
* fix time issues and add some tests for time

* fix tests bug

* fix tests

* some fixes with tests and added mssql support

* fix tests
2017-06-02 16:12:50 +08:00
Lunny Xiao 8729bffe74 fix distinct & top conflict on mssql (#596) 2017-05-31 09:01:50 +08:00
Lunny Xiao 6b6721cccc
fix bug on sum 2017-04-17 15:52:52 +08:00
Lunny Xiao 15f11df2af
fix #570 2017-04-14 13:55:55 +08:00
Lunny Xiao a0b6b62ba0
fix #570 2017-04-14 10:49:02 +08:00
Lunny Xiao 7e70eb8222
refactor automaptype 2017-04-02 18:02:47 +08:00
Lunny Xiao 5ebae720bd
add Scan features to Get method 2017-04-01 10:09:00 +08:00