1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-18 03:50:54 +00:00
Commit Graph

389 Commits

Author SHA1 Message Date
mlgd
3332dbe595 Update for MySQL timezone detection bug
Use "DefaultTimeLoc" for "al.TZ" default value
Don't set TZ on alias when t.Location() is empty

You can set your MySQL server timezone on main.go init function.
Example :
orm.DefaultTimeLoc, _ = time.LoadLocation("Europe/Paris")
2017-10-26 14:32:42 +02:00
astaxie
b169ea4b63 Merge pull request #2896 from tinycedar/master
misc: fix typos
2017-10-17 21:22:27 +08:00
Daniel Lin
72ec4df679 Merge branch 'master' into master 2017-10-17 04:30:59 -05:00
hzlinqien
b91263a254 misc: fix typos 2017-10-17 17:27:03 +08:00
astaxie
a7354d2d08 Revert "should use time.Since instead of time.Now().Sub" 2017-09-09 06:29:38 +08:00
wangguoliang
c8c25549e7 should use time.Since instead of time.Now().Sub
Signed-off-by: wgliang <liangcszzu@163.com>
2017-09-07 19:01:34 +08:00
Erik
510dd02a06 Fix the quick start section of the orm/README.md
Increase the init method by adding the `RunSyncdb` method to resolve the problem that the table is not created.
2017-08-11 11:34:18 +08:00
satng
83a563c0ab oracle插入占位符 2017-07-09 12:25:51 +08:00
astaxie
9765519f38 Merge pull request #2637 from alexsunxl/develop
allow o.Raw(sql).QueryRows(&container) pass nested struct
2017-05-17 16:45:14 +08:00
astaxie
3c9b6c99b7 Merge pull request #2643 from rbw0/master
Spelling fixes
2017-05-16 11:26:16 +08:00
Robert Wikman
b5c6eb54d2 Missing PK error spelling fix 2017-05-16 00:58:20 +02:00
Robert Wikman
e1c90bfc09 Table not found spelling fixes 2017-05-16 00:27:57 +02:00
alexsunxl
2325090101 add test case that used nested struct test QueryRows 2017-05-14 12:03:34 +08:00
sunxinle
589f3755f0 允许o.Raw(sql).QueryRows(&container) 传入的container包含结构的嵌套 2017-05-12 18:11:42 +08:00
guanly
10cd1070f4 使用sqlite,orm中通过filter后的delete删除不成功
https://github.com/astaxie/beego/issues/2630
2017-05-11 21:45:38 +08:00
guanly
9b01b1c63d ISSUE2630 使用sqlite,orm中通过filter后的delete删除不成功
https://github.com/astaxie/beego/issues/2630
2017-05-11 14:49:01 +08:00
astaxie
79b66ef053 fix the beego ORM test 2017-04-30 22:55:39 +08:00
astaxie
a91e2e9950 add golint check and fix all golints 2017-04-30 22:41:23 +08:00
astaxie
1c32c011a1 fix misspell 2017-04-28 23:37:40 +08:00
astaxie
64b475d7d6 fix ReadOrCreate test case 2017-04-28 22:58:17 +08:00
astaxie
aa8f7bc146 fix ineffectual 2017-04-28 22:36:28 +08:00
astaxie
3e29078f68 add check ineffect and gofmt 2017-04-28 21:38:08 +08:00
astaxie
e810f2e930 add more oracle alias 2017-04-24 21:36:07 +08:00
OlegFX
712df81c99 Fixed InsertOrUpdate bug 2017-04-21 19:57:04 +03:00
astaxie
c12709dbc9 Merge pull request #2536 from ChristophPech/master
Fix for IndexExists in SQLite driver
2017-03-29 09:53:55 +08:00
Christoph Pech
2808a13f07 Fix for IndexExists in SQLite driver, they added the "origin" and "partial" columns to the index_list pragma.
see: https://www.sqlite.org/src/info/2743846cdba572f6
2017-03-28 12:38:27 +02:00
astaxie
d956444965 Merge branch 'develop' into add-gosimple 2017-03-18 11:20:30 +08:00
Sergey Lanzman
37c1ffc57a add go simple support 2017-03-17 20:22:20 +02:00
Sergey Lanzman
856fde28dc add unconverted support 2017-03-17 19:45:30 +02:00
astaxie
1e5051e112 Merge pull request #2381 from chesedo/OrmStrongRelationships
Add strong relationship support to orm
2017-03-05 22:39:45 +08:00
astaxie
be586572e0 Merge pull request #2423 from ansiz/master
Add config field EnableErrorsRender
2017-02-10 13:19:20 +08:00
astaxie
b0dcb5b91d Merge pull request #2400 from kerwin/master
Add GetCond func to querySet
2017-01-23 21:12:29 +08:00
kerwin
5c76f62103 Add GetCond func to querySet 2017-01-18 17:04:23 +08:00
杜亚哲
24d8290a3f fix filter with __ne bug 2017-01-16 10:32:33 +08:00
chesedo
82d2ace3bd Add strong relationship support to orm 2017-01-11 20:16:38 +02:00
Faissal Elamraoui
86f6470fb2 Merge pull request #2353 from skariuki/master
Fixed typo in orm/models_boot.go
2016-12-29 22:50:41 +01:00
Kariuki, Stanley (Contractor)
caca5e37ba fixed typo in models_boot 2016-12-29 12:26:20 -05:00
legendtkl
c9c284be27 Modify func camelString to be more robust
1. In previous edition, for case "pic_url_1", the func will return
"PicUrl_1", but "PicUrl1" seems to be more reasonable.
2. More test cases please refer to utils_test.go
2016-12-25 21:09:06 +08:00
astaxie
e2d9d34c75 Merge pull request #2272 from szyhf/Fix#2263
Another Fix to #2263
2016-12-05 22:40:54 +08:00
Dusan Kasan
34e2b26b99 resolves #2291, introduces AndNotCond/OrNotCond to orm.Condition 2016-11-28 09:49:06 +01:00
Back
b5c29d6143 Fix #2263
Update db_mysql.go instead of db.go, in order to avoid affect other database.
2016-11-08 13:39:31 +08:00
Sergey Shcherbina
8beefc8bfd Fixed bug when all "time.Time" params in raw sql queries formatted as time 2016-10-17 21:51:31 +05:00
astaxie
5ceac1dd04 string convert int fail use math/big fix #756 2016-10-12 15:04:31 +08:00
astaxie
e0c59fcf0b add more comments 2016-09-22 23:17:41 +08:00
astaxie
a58115fed2 orm log delete repetition time 2016-09-15 10:54:21 +08:00
astaxie
d5fb74aa94 Merge pull request #2158 from simpleelegant/develop
Add support "SELECT FOR UPDATE" to orm. Resolve issue #2157
2016-09-12 21:48:14 +08:00
Wang Yujian
11247d41a7 Add support "SELECT FOR UPDATE" to orm. Resolve issue #2157 2016-09-12 20:07:30 +00:00
astaxie
5b21c7cd71 fix #1802 2016-09-12 21:13:21 +08:00
astaxie
7d6c45d4c9 add RegisterModelWithSuffix #2140 2016-09-06 23:05:41 +08:00
astaxie
c697b98006 enhancement 2016-09-01 23:28:34 +08:00
astaxie
56aa224a6e simplfy the code 2016-08-31 22:47:31 +08:00
astaxie
8c37a07adb optimize the ORM 2016-08-31 00:07:19 +08:00
astaxie
aa091cea42 improvement the error if use &&Struct 2016-08-30 22:02:11 +08:00
astaxie
fb2343567b fix #2125 2016-08-30 20:40:46 +08:00
astaxie
3f67c62dd8 revert the snakeString 2016-08-30 00:15:02 +08:00
astaxie
68311b286e gofmt -s -w . 2016-08-17 22:49:30 +08:00
astaxie
7b542e612f Merge pull request #1964 from qAison/master
fix fk field null value
2016-08-02 10:00:24 +08:00
“fudali113”
cacf6cde19 update db.go 2016-07-26 14:27:22 +08:00
“fudali113”
4e10100575 update orm_test 2016-07-26 12:44:16 +08:00
“fudali113”
f471ee9025 update orm_test 2016-07-26 12:19:06 +08:00
“fudali113”
182a21172f Optimize the code logic 2016-07-26 11:15:59 +08:00
“fudali113”
bf17558d06 update “modification hardcode 2 2016-07-22 12:25:30 +08:00
“fudali113”
e0e888ab8f update “modification hardcode 2016-07-22 12:10:37 +08:00
“fudali113”
3583ad8cc0 update annotation 2016-07-21 15:49:55 +08:00
“fudali113”
e2316c4b9e update 2016-07-20 17:28:26 +08:00
“fudali113”
6d1b203bca update 2016-07-20 16:52:14 +08:00
“fudali113”
50c5df32b1 update 2016-07-20 16:26:02 +08:00
“fudali113”
530c32017c update 2016-07-20 15:33:30 +08:00
“fudali113”
ec521ad166 update 2016-07-20 15:13:18 +08:00
“fudali113”
4b8ecced83 orm insert or update 2016-07-20 14:37:05 +08:00
Victor Popkov
415b9cf310 add support for time.Time pointer in struct types
Allow to use pointer *time.Time as a type in combination with orm tags in struct. This enables to treat them as "empty" in JSON marshaling/unmarshaling when using 'json:"null,omitempty'.
2016-06-22 16:57:05 +03:00
ysqi
3f016840db fixed test error 2016-06-04 10:41:55 +08:00
ysqi
d528fafd43 ignore case of tag and fixed bug for columName 2016-06-03 22:06:43 +08:00
wy65701436
d4d7621942 modify the error log for registerModel to tell user the default hard code PK is 'id'. 2016-05-27 02:03:58 -07:00
qAison
761b6c129c count func add support group by 2016-05-27 14:34:45 +08:00
qAison
8f0749ddee fix fk field null value 2016-05-27 13:53:28 +08:00
wincss
a4d4b8de77 fix #1936 2016-05-10 17:45:06 +08:00
astaxie
520a417cca Merge pull request #1874 from Maxgis/master
change limit 1000 to 1,reduce the amount the data
2016-04-26 09:56:44 +08:00
maxin[马鑫]
56dc9bf622 add return ErrMultiRows 2016-04-25 15:51:12 +08:00
maxin[马鑫]
9ce6dc4cdf remove test ; because rows are returned in an unspecified order 2016-04-13 21:04:46 +08:00
miraclesu
903e21bef2 orm: add test case for InsertMulti 2016-04-13 20:22:27 +08:00
miraclesu
3a3f70027c orm: fix panic multi insert when slice lenght is 1 & the value is pointer 2016-04-13 20:14:02 +08:00
maxin[马鑫]
81c6c898cf remove orm one function thorw ErrMultiRows error 2016-04-13 10:36:12 +08:00
maxin[马鑫]
9679f5e22a reduce the data transmission 2016-04-12 21:28:29 +08:00
miraclesu
5185816942 orm: use text as postgres default type 2016-04-12 21:19:43 +08:00
miraclesu
99f1e6c8b5 orm: fix golint 2016-04-12 11:00:31 +08:00
miraclesu
e95bef1331 orm: add test case for json & jsonb type support 2016-04-12 11:00:31 +08:00
miraclesu
657744efb1 orm: add json & jsonb type support 2016-04-12 11:00:31 +08:00
maxin[马鑫]
553078d956 change limit 1000 to 1,reduce the amount the data 2016-04-11 09:02:22 +05:30
Ivan Cadri
d49c7f96cb added functionality for column type time
updated the model_fields to cater for the time field type
2016-04-03 16:58:19 +02:00
miraclesu
1794c52d65 orm: fix postgres sequence value 2016-03-27 15:06:57 +08:00
miraclesu
3ca44071e6 orm: insert specified values for insertMulti 2016-03-26 21:51:05 +08:00
miraclesu
e0a36fb61e Merge branch 'develop' into feature/orm_auto 2016-03-26 21:16:52 +08:00
miraclesu
3e2ffa545f orm: fix postgres returning id error 2016-03-24 20:03:45 +08:00
miraclesu
eaf38bb096 orm: add test case for uint pk read or create 2016-03-23 21:59:09 +08:00
miraclesu
3be6688cd1 orm: fix painc when pk is uint on ReadOrCreate 2016-03-23 21:57:57 +08:00
miraclesu
8f70df6c7b orm: add test case for insert specified value to auto field 2016-03-23 20:28:22 +08:00
miraclesu
1786b16e61 orm: support insert a specified value to auto field 2016-03-23 20:16:18 +08:00
astaxie
ba7a809de8 Merge pull request #1810 from miraclesu/fix/orm_miss_pk
orm: fix miss pk when pk is negative
2016-03-22 10:09:35 +08:00
miraclesu
84ae930c64 orm: Add test case for integer pk 2016-03-18 21:58:11 +08:00
miraclesu
a3d4218d9d orm: fix miss pk when pk is negative 2016-03-17 21:41:35 +08:00
JessonChan
ec35bd0c28 orm log header flag 2016-03-16 18:04:27 +08:00
miraclesu
dcfcb2789e orm: inline struct relate test case 2016-03-13 21:04:39 +08:00
astaxie
1f0a65f0a2 fix the orm test 2016-03-10 22:21:21 +08:00
astaxie
31f7524dae fix the golint travis 2016-03-10 21:47:50 +08:00
astaxie
3a12e238cc support oracle 2016-03-10 21:23:13 +08:00
miraclesu
64e0858d44 orm: add inline struct test case 2016-03-08 22:24:38 +08:00
miraclesu
85f55fcb41 orm: inline struct support 2016-02-24 18:46:14 +08:00
astaxie
441f795a1a Merge pull request #1651 from thanhtranjs/develop
Add GroupBy to QuerySeter
2016-02-02 12:44:49 +08:00
Thanh Tran
bb50383aa9 Add GroupBy to QuerySeter 2016-02-02 11:28:43 +07:00
astaxie
fdce4af9c8 fix #1619 2016-01-25 20:53:52 +08:00
astaxie
f925bb9058 golint all the files 2016-01-18 00:18:21 +08:00
astaxie
90d1349665 fix typo 2016-01-17 23:48:17 +08:00
astaxie
a304bb9c25 Revert "add test case for tidb"
This reverts commit f70d2cc373.
2016-01-17 18:35:11 +08:00
astaxie
f70d2cc373 add test case for tidb 2016-01-17 18:24:29 +08:00
astaxie
797571c85f fix the ORM test case 2016-01-15 14:36:45 +08:00
astaxie
a069c73b3a test case bool default value is true 2016-01-15 14:02:08 +08:00
astaxie
7dbeb2c39a fix the default value 2016-01-15 08:43:02 +08:00
astaxie
4375ca84d1 fix the sqlite m2m 2016-01-14 23:49:28 +08:00
astaxie
fd608d2bf6 disable tidb testing 2016-01-08 19:59:20 +08:00
astaxie
7fbaf82897 fix #1424 2016-01-04 22:10:18 +08:00
fud
92711e80a3 refactor controller.go 2015-12-21 16:23:31 +08:00
astaxie
a4f674e7f4 Merge pull request #1483 from nkbai/develop
为orm接口添加注释
2015-12-17 22:23:32 +08:00
astaxie
e5096be32b Merge pull request #1490 from pjoe/orm_pk_rel_many
Fix joins for reverse(many) with custom pk
2015-12-17 14:56:06 +08:00
Pelle Johnsen
906637ae8b Fix issue with reverse(many) for models with custom pk
- Also add test covering the issue
2015-12-15 17:39:08 +01:00
nkbai
3daaaeb32b add commit for orm/types.go 2015-12-15 19:48:28 +08:00
nkbai
b079456fcf add comments for orm/types.go 2015-12-14 15:04:17 +08:00
astaxie
ed99c013a6 Revert "Update orm_querym2m.go" 2015-12-02 16:35:36 +08:00
astaxie
a1d5f958c5 Merge pull request #1464 from gobenon/master
Update orm_querym2m.go
2015-12-02 16:35:05 +08:00
gobenon
50f8f3bd20 Update orm_querym2m.go 2015-11-30 18:23:58 +02:00
astaxie
2c94d9eab2 Merge pull request #1451 from gobenon/master
fix issue 1438 opened by Ayelet Regev
2015-11-25 09:29:28 +08:00
gobenon
efd30bdba7 Update orm_querym2m.go 2015-11-19 16:46:14 +02:00
gobenon
ca37557a26 Update orm_querym2m.go 2015-11-19 14:30:14 +02:00
astaxie
25bec8bbe9 Merge pull request #1381 from ADone/m2m_reverse_bug
fix #671
2015-11-04 23:20:22 +08:00
astaxie
a257a924a1 Merge pull request #1379 from pjoe/non_int_fk
orm: Fix handling of rel(fk) to model with string pk
2015-11-04 22:26:33 +08:00
Pelle Johnsen
174e758d19 Fix dbBase.Update not returning error 2015-09-28 14:07:35 +02:00
Pelle Johnsen
cfcce4f5dc Fix handling of rel(fk) to model with string pk 2015-09-22 12:23:51 +02:00
astaxie
4823a0f114 remove the dead code 2015-09-17 23:47:26 +08:00
astaxie
3df0fa462d golint tidb 2015-09-17 23:00:05 +08:00
ngaut
09b7457ac6 orm_test: Skip relation test 2015-09-17 17:05:40 +08:00
ngaut
c841a77ad6 Orm: Add tidb for query builder 2015-09-17 17:04:23 +08:00
ngaut
c73e0395ed Orm: Support TiDB 2015-09-17 17:04:23 +08:00
astaxie
68ec133aa8 golint orm 2015-09-12 21:46:43 +08:00
f0r
a074df9c2e 为querySeter添加GroupBy方法 2015-09-03 00:45:09 +08:00
Pelle Johnsen
0c33673197 Revert spaces > tabs change 2015-08-24 09:41:10 +02:00
Pelle Johnsen
19d82ab62c Fix #1274: Add QuerySeter.Distinct() 2015-07-22 18:12:57 +02:00
Artem Nistratov
5612f61a93 fix #671 2015-07-08 17:42:00 +03:00
空见
bbb6f31f16 support eq&ne for orm 2015-06-09 10:18:21 +08:00
Trần Văn Thanh
0222b8d693 fixed: when RelatedSel have multi string/relation, it only get last string 2015-05-25 09:10:36 +08:00
astaxie
1d8afdc9c9 gofmt -s & go_vet 2015-05-25 09:10:34 +08:00