Commit Graph

334 Commits

Author SHA1 Message Date
Bo-Yi Wu 0b841796fa fix: add const value for public scheam name of postgres. (#877) 2018-04-09 14:57:11 +08:00
Bo-Yi Wu 468154dfd5 chore(postgres): support add schema as prefix of table name (#875)
* chore(postgres): support add schema as prefix of table name

* fix: ignore DefaultPostgresSchema

* docs: [ci skip] add desc for postgres.
2018-04-08 23:49:59 +08:00
Lunny Xiao 430fbe866a
add FindAndCount method (#842) 2018-02-07 07:06:13 -06:00
Lunny Xiao b6ba097a50
improve error string & fix #789 (#790) 2017-12-02 14:39:56 +08:00
Lunny Xiao 3bb2fa9c85
add lost Prepare 2017-11-29 10:03:54 +08:00
Lunny Xiao a6cc098689
QueryString and QueryInterface supports composite conditions (#784) 2017-11-20 16:14:27 +08:00
Lunny Xiao de4b2f9c8e
Query now could work with Where, In, SQL and other condition methods (#776) 2017-11-15 11:34:59 +08:00
Lunny Xiao 109cb1a7d0 Add support Engine Group (#748)
* add support group engine

* revert code

* add NewGroup function

* add engine group policy

* rename file name

* modify policy interface

* remove Init function from policy interface

* refactor Group Policy

* rename and comments

* rename and bug fix for WeightRoundRobinPolicy

* modify Slave function

* modify Slave function and add LeastConnPolicy

* use original Engine and Session

* remove unused count variables

* fix bug on NewEngineGroup

* remove unused method

* improve range and refactor

* add some comments and refactor

* implement GroupPolicy of GroupPolicyHandler

* refactor

* simple code

* add tests support for EngineGroup & fix some bugs

* improve the NewEngineGroup interface

* change the default policy of engine group

* fix some tests
2017-10-16 15:28:13 +08:00
Lunny Xiao 7dc8e7623c fix time tag utc (#742)
* fix time tag utc

* rename NowTime -> nowTime
2017-09-30 08:59:13 +08:00
Lunny Xiao c9690500fa add buffer Iterate support (#729) 2017-09-19 20:59:41 +08:00
Lunny Xiao 763e1b21e6 Add query interface (#695)
* add query interface

* fix tests of query interface
2017-08-27 22:09:31 +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 a10b5aba4b reduce sessions on Sync (#685) 2017-08-20 17:05:42 +08:00
Lunny Xiao c2e915ffc1
fix typo 2017-07-31 20:26:13 +08:00
Lunny Xiao 4524e40dda add NotIn and more tests for tag (#665) 2017-07-27 17:48:19 +08:00
Lunny Xiao f1aebd5729 hide all undocument variables on session (#660) 2017-07-27 13:32:35 +08:00
Lunny Xiao 774f83c1bc add Exist functions (#640) 2017-07-14 09:20:13 +08:00
Oleh Herych 682b827c7e More clear log (#638)
I don't see `nil` in log. I suggest the next changes 

*Before*
```
INSERT INTO `dish` (`dish_id`,`restaurant_id`,`name`,`source`,`entry_id`,`created_by`,`menu_id`,`category`,`description`,`price`,`score`,`flog_count`,`approve`,`activated`,`created_at`,`updatated_at`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [59639fb56d9d9437b707a434 58a313719fee7b336da70c45 Chocolate Mousse Torte fsqi 51339970   Dessert Seasonal berry sauce 0 0 0 1 false 2017-07-10 18:39:33 2017-07-10 18:39:33]
```

*After*
```
INSERT INTO `dish` (`dish_id`,`restaurant_id`,`name`,`source`,`entry_id`,`created_by`,`menu_id`,`category`,`description`,`price`,`score`,`flog_count`,`approve`,`activated`,`created_at`,`updatated_at`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) []interface {}{"59639ec16d9d943782ce2f6c", "58a313719fee7b336da70c45", "Chocolate Mousse Torte", "fsqi", "51339970", "", "", "Dessert", "Seasonal berry sauce", 0, 0, 0, 1, false, "2017-07-10 18:35:29", "2017-07-10 18:35:29"}
```
2017-07-11 09:16:07 +08:00
Mamoru Murakami 39a812d59d Topic/fix cache uint (#635)
* modify cache_test for issues #330

* fix bugs cache key when pk is defined as uint (#330)

* add comment
2017-07-06 13:03:06 +08:00
Lunny Xiao 2af18acf72 add CondDeleted method (#620) 2017-06-15 20:09:46 +08:00
Lunny Xiao 233706969a
add SumInt method 2017-06-12 16:33:11 +08:00
Lunny Xiao 7a9bf19c65 move lifetime to a split file so that go1.1 is also work with this feature (#612) 2017-06-08 10:21:01 +08:00
Lunny Xiao a4a8e4a739 fix bug and add set conn max lifetime (#606)
* fix sqlite bug and add SetConnMaxLifetime

* add parse for composite keys

* required go 1.5+
2017-06-05 15:08:30 +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 7154d2c42d add more tests (#595)
* add more tests

* fix tests
2017-05-30 20:33:30 +08:00
Lunny Xiao e561396c0b
add more tests for schema 2017-05-27 22:14:13 +08:00
Lunny Xiao 1ff7790a2e
fix bug for int64 id tag 2017-05-17 17:05:36 +08:00
Lunny Xiao d52a762fba
remove unused code 2017-04-21 00:02:48 +08:00
Lunny Xiao 564b75cdc0
bug fix #572 2017-04-20 23:35:48 +08:00
Lunny Xiao 71e934b5c6
remove trace code 2017-04-12 14:35:29 +08:00
Lunny Xiao e9dc216344
bug fixed #565 2017-04-11 19:38:54 +08:00
Lunny Xiao aae045f9aa
fix #563 2017-04-10 19:45:00 +08:00
Lunny Xiao 7e70eb8222
refactor automaptype 2017-04-02 18:02:47 +08:00
Lunny Xiao 5497f76c84
add QueryString support 2017-04-01 10:35:27 +08:00
Lunny Xiao bda5f17e01 Handle xorm tags via tagHandler prepared for customerize tag support (#551)
* handle xorm tags via tagHandler prepared for customerize tag support

* add some comments and improvements
2017-03-30 10:39:38 +08:00
Lunny Xiao c352f30dd2
improved SQL log 2017-03-17 20:30:00 +08:00
Lunny Xiao 19f6dfc2e8
bug fix for dump to postgres 2017-02-10 09:55:37 +08:00
Shintaro Kaneko 71190ff044 Apply the given location instead of engine.location (#435) 2017-01-25 19:48:19 +08:00
Lunny Xiao 0b209de773
Merge branch 'master' of github.com:go-xorm/xorm 2017-01-25 18:59:59 +08:00
Lunny Xiao 57bcb65078
bug fix for get sqlite meta informations 2017-01-22 17:17:55 +08:00
n4mine 7c70e8caa9 fix: typo (#524) 2017-01-21 22:51:25 +08:00
Lunny Xiao c360c20aa5
dump support bool 2017-01-20 10:12:06 +08:00
Lunny Xiao 263f9d3fa5
bug fixed for dump 2017-01-18 23:08:43 +08:00
Lunny Xiao b1bbae3949
Let DumpAll support dump to another database 2017-01-18 20:14:20 +08:00
Lunny Xiao 664a52a6d7
some gofmt & golint fixed 2017-01-09 09:52:23 +08:00
Lunny Xiao 2189b36884
fix dump to other databases 2017-01-03 14:44:30 +08:00
Lunny Xiao c60f2467a9
some golints fixed 2016-12-11 12:45:37 +08:00
Sergey Kurt a618e46460 Columns string generation via bytes.Buffer 2016-11-07 14:47:42 +03:00
Lunny Xiao bccd20a7c5 resolved #474 2016-10-23 10:24:29 +08:00
Lunny Xiao cd9eef351a bug fixed for errorf 2016-10-19 16:55:38 +08:00
yyoshiki41 47def2ea58 Remove quoteColumn method 2016-10-05 00:39:08 +09:00
sawada_shinnosuke 1b423b7807 use defer prepareing for panic/recover 2016-09-26 12:44:23 +09:00
Lunny Xiao 7b5ac89633 add *builder.Builder as pointer to .SQL 2016-09-23 10:08:28 +08:00
Lunny Xiao 01c5ff6337 added condition query builder support via github.com/go-xorm/builder 2016-09-17 20:04:52 +08:00
Lunny Xiao db48d70fd0 bug fixed for table name detect on insert a slice 2016-08-22 12:56:40 +08:00
Shintaro Kaneko edda763c13 Modify extract LOCALE sign from tags 2016-08-05 10:05:05 +00:00
yyoshiki41 9e0ab5cfbd Remove unused method 2016-07-19 16:17:50 +09:00
Jim Salem ad5c1a5215 Allow the database's timezone to be specified. See https://github.com/go-xorm/xorm/issues/419 2016-07-13 17:57:21 -04:00
Lunny Xiao ea9a4495ac golint and comments 2016-07-11 11:29:34 +08:00
Lunny Xiao 5612916fea bug fixed and performance improved for table name 2016-07-09 08:15:53 +08:00
Lunny Xiao 86701ad07e added Sum, Sums, SumsInt methods 2016-07-07 22:34:43 +08:00
Lunny Xiao 7d0f249cf5 resolved #416 2016-06-30 16:35:04 +08:00
yyoshiki41 800f4b35db Fixed driver-name logging 2016-06-30 15:45:02 +08:00
Lunny Xiao b336fa1880 ILogger interface changed and some golint issues resolved, #367 resolved 2016-03-31 18:19:00 +08:00
Lunny Xiao 7d2967c786 join parameters support & many comments 2016-03-29 09:17:06 +08:00
Lunny Xiao a2a2456fa2 bug fixed for log level and improved json scanner 2016-03-24 22:46:24 +08:00
woodsaj 1080a66c10 allow quoteColoumn to handle comma separated column names 2016-03-14 22:23:45 +08:00
woodsaj ce380c9430 quote "."(periods) in column name. fixes #369
Correctly handle columns being passed in the format
"table.column"
2016-03-14 22:10:59 +08:00
Wenhui Shen 54473a3e45 fixed bug 2016-03-13 16:28:18 +08:00
Lunny Xiao 5df1bc92df resolved gogits/gogs#2743 2016-03-06 12:05:20 +08:00
Lunny Xiao 4fec1167de add schema support for postgres 2016-03-03 11:03:26 +08:00
Lunny Xiao 8c05434162 bug fixed for engine.ShowExecTime 2016-03-01 18:23:33 +08:00
Lunny Xiao 4bcbb95688 added DumpTables and DumpTablesToFile for dump parts of tables to other database type 2016-02-29 22:32:41 +08:00
Lunny Xiao 0c38bdb041 Merge pull request #355 from safeie/master
compatible TableName method declare use struct pointer
2016-02-16 17:30:33 +08:00
Lunny Xiao a0aaa7d72b logging interface changed and resolved #160 #219 #353 2016-02-16 17:18:01 +08:00
safeie f3a7ed63d4 compatible TableName method declare use struct pointer 2016-02-16 16:18:44 +08:00
Lunny Xiao 791d17fed6 some improvments 2016-01-28 16:54:15 +08:00
Lunny Xiao fad61020e8 resolved #250, #317 2016-01-02 23:55:01 +08:00
Lunny Xiao 8700152b6c resolved #67 2016-01-02 22:58:49 +08:00
Lunny Xiao 0cae9529c1 beautify for dump sql 2015-11-24 15:13:53 +08:00
Lunny Xiao 4d5da3bb4d bug fixed for dump 2015-11-24 14:25:06 +08:00
Lunny Xiao 6d9fe27a6d disable gob register if cache is not enabled 2015-10-10 10:32:08 +08:00
evalphobia 1ebd50ead5 Added feature to update with null for non pointer value 2015-06-10 23:04:14 +09:00
Lunny Xiao 439cc27466 added Select method for special select column express 2015-05-24 21:32:27 +08:00
Lunny Xiao f9c968d98a dialect interface changed 2015-05-19 22:39:50 +08:00
Lunny Xiao a7e7288163 bug fixed 2015-05-18 17:04:25 +08:00
Lunny Xiao 1992491553 license 2015-04-28 16:25:04 +08:00
Lunny Xiao a068aadd27 use old drop table interface 2015-03-12 18:03:52 +08:00
Lunny Xiao 53da67f171 Merge branch 'master' into oci8_support 2015-03-12 17:47:11 +08:00
马金凯 d227340c7a bugfix #213
参考帮助文档 [自动映射的规则](http://gobook.io/read/go-xorm/manual-zh-cn/chapter-02/4.columns.html) 中的说明

> 如果field名称为Id而且类型为int64并且没有定义tag,则会被xorm视为主键,并且拥有自增属性。如果想用Id以外的名字或非int64类型做为主键名,必须在对应的Tag上加上xorm:"pk"来定义主键,加上xorm:"autoincr"作为自增。这里需要注意的是,有些数据库并不允许非主键的自增属性。

因此在使用`core.GonicMapper`时,忽略了ID主键
2015-03-06 16:06:19 +08:00
ilisin 7acdf292bf for oracle support
modify base on lastest version of xorm
2015-03-05 09:56:15 +08:00
Lunny Xiao 1d28ab2dcf bug fxied 2015-02-28 15:45:24 +08:00
Lunny Xiao 0cfd60f101 use DB() instead newDb() 2015-02-25 15:26:52 +08:00
Lunny Xiao 507ee4df02 resolved #163 2015-02-23 12:24:26 +08:00
Lunny Xiao 5cdb680945 add cascade non-int64 primary key support & bug fixed #178 2015-02-22 23:52:53 +08:00
Lunny Xiao 7e3812ca28 created, updated Unix() support 2015-02-22 10:39:35 +08:00
Lunny Xiao 5af80770ea bug fixed #210 2015-02-16 21:12:22 +08:00
Lunny Xiao 2876528540 add IsTableExist & IsTableEmpty 2015-02-12 11:46:03 +08:00
江林锦 5b2b0091de Expr() => SetExpr() 2015-01-28 14:10:45 +08:00
江林锦 5a47ac4347 implement Expr() 2015-01-28 13:23:01 +08:00