Jay Taylor
a03d7d8798
Merge c53f494ff6982962e83570a6111dc51fc3d413ff into 92e08097167b30928160f3ceb6b5497ec0a1199d
2015-08-19 13:55:47 +00:00
Jinzhu
92e0809716
Don't save associations if has any error happened
2015-08-18 11:09:03 +08:00
Jinzhu
81c00fdc8f
Don't add duplicated error
2015-08-18 11:09:03 +08:00
Jinzhu
24aeec7a1e
Merge pull request #625 from wallclockbuilder/patch-1
...
Add documentation info
2015-08-18 09:24:24 +08:00
Jinzhu
9982134955
Fix preload many2many with multiple primary keys
2015-08-18 09:19:50 +08:00
Mawueli Kofi Adzoe
8f901b4b55
Add documentation info
2015-08-18 01:03:00 +00:00
Jinzhu
6a6c1bf762
Remove not necessary PreloadWithJoin
2015-08-18 08:05:44 +08:00
Jinzhu
7ec2b87312
Add more preloading many2many tests
2015-08-18 07:47:00 +08:00
Jinzhu
a24417824d
More improvements for preload many2many
2015-08-18 07:43:08 +08:00
kimiby
07571d1adf
increase performance m2m preload
2015-08-17 22:28:40 +03:00
Jinzhu
e2689d335b
Merge branch 'kimiby-many2many_preload'
2015-08-17 23:11:54 +08:00
Jinzhu
f8e2f04562
Some Tweaks for Preload Many2Many, Add tests with inline conditions
2015-08-17 23:09:07 +08:00
Jinzhu
27511118fe
Update Preload Many2Many tests
2015-08-17 22:19:10 +08:00
Jinzhu
3ca4a72a4c
Handle DB error in callbacks
2015-08-17 16:50:42 +08:00
Jinzhu
018a7e69ec
Handle DB error in callbacks
2015-08-17 16:38:01 +08:00
kimiby
281c5d10f6
preload_m2m improve
2015-08-16 12:36:23 +03:00
kimiby
f35dee5531
preload_m2m fix and test
2015-08-16 12:25:25 +03:00
kimiby
fbce0d98f6
m2m preload utils
2015-08-16 10:35:58 +03:00
kimiby
42c3f39163
m2m preload
2015-08-16 10:10:11 +03:00
Jinzhu
dd0d4d931f
Add errorsInterface
2015-08-14 14:53:26 +08:00
Jinzhu
0996ddb604
Rename Errors to GetErrors
2015-08-14 12:29:53 +08:00
Jinzhu
309740983e
Add Errors
2015-08-14 11:04:05 +08:00
Jinzhu
e1ce3b7066
Merge branch 'jaytaylor-jay/ddl-errors'
2015-08-13 09:09:37 +08:00
Jinzhu
197ae0e893
Fixed detecting pointers as a Scanner. thanks @NOX73
2015-08-13 09:05:35 +08:00
Jinzhu
905b6232a3
Fix can't call callbacks for embedded pointers
2015-08-13 09:04:21 +08:00
Leon Maia
ff3c23c9e9
fixes #593 - Dont include quotes on dest table
2015-08-13 09:04:21 +08:00
Jinzhu
ab1832b9a5
Handle children db's Error in callbacks
2015-08-13 09:04:21 +08:00
Jay Taylor
17917d49d8
Reverted to original `NewRecord' func as per @jinzhu's feedback.
2015-08-12 09:32:18 -07:00
Jinzhu
1d4f908ea2
Fixed detecting pointers as a Scanner. thanks @NOX73
2015-08-12 22:28:01 +08:00
Jinzhu
7fcb3e889f
Merge pull request #600 from jaytaylor/jay/current_database
...
`CurrentDatabase' implementation.
2015-08-12 22:03:49 +08:00
Jay Taylor
526fff01b7
Merge branch 'jay/current_database' into jay/ddl-errors
2015-08-11 09:05:53 -07:00
Jay Taylor
beeb040c62
Reworked CurrentDatabase API to return the name instead of `*gorm.DB'.
2015-08-11 08:59:59 -07:00
Jinzhu
1a07673e97
Fix can't call callbacks for embedded pointers
2015-08-10 12:51:12 +08:00
Jinzhu
8efbe276e8
Merge pull request #603 from leonmaia/master
...
fixes #593 - Dont include quotes on dest table
2015-08-10 10:43:32 +08:00
Jay Taylor
da31f58607
Ensure DDL dialect queries propagate error states to descendent scopes.
...
Includes relevant unit-test.
Branched from jay/current_database (please merge that branch first!).
2015-08-08 14:25:15 -07:00
Jay Taylor
70725f9d77
`CurrentDatabase' determines current dbname by querying the database.
...
Preserves the gorm-style query API.
2015-08-08 08:56:23 -07:00
Jay Taylor
c53f494ff6
Recalculate fields in `Scope.Fields' when empty (nil) or number of fields is LTE 1.
...
Protect the `.fields' variable state from partial-initialization timing
issues.
As gorm warms state and makes `.GetStructFields' calls, they lead to a long
deferred function in model_struct.go. Then the deferred function calls
`Scope.Fields', leading to another `.GetStructFields' call.. cyclically.
Once information is cached the cycling ends.
This extra rule evicts incorrect/suspiciously short fields information.
Symptom of incorrect internal state ocurring can manifest as invalid
insert SQL statement errors generated during `DB.Save', e.g.:
INSERT INTO "your_table" DEFAULT VALUES RETURNING "your_table"."id"
This is why we refresh if nil or only a single field (usually is the ID field).
Included is a unit-test which triggers the scenario and prove that it is
fixed.
2015-08-07 22:17:51 -07:00
Leon Maia
6d91f300f5
fixes #593 - Dont include quotes on dest table
2015-08-07 17:16:40 -03:00
Jinzhu
fd9e42655f
Handle children db's Error in callbacks
2015-08-07 16:35:48 +08:00
Jinzhu
d21eed4b66
Don't include Order for counting sql
2015-08-05 15:58:11 +08:00
Jinzhu
6b8f2fcab8
Send a ping to make sure the database connection is alive, thanks @pariz
2015-08-02 07:37:33 +08:00
Jinzhu
0def184b0c
Merge pull request #572 from eirmag/master
...
Table suffix to create tables with InnoDB engine
2015-08-02 07:28:42 +08:00
Gabriel
eef40a06ff
Rename the parameter to table_options and avoid introduction of new API function OpenWithTableSuffix
2015-08-01 22:46:38 +00:00
Jinzhu
a7762ea7d6
Return error happend in Create/Update when using FirstOrCreate
2015-08-01 12:00:35 +08:00
Jinzhu
e2e417a8c2
Fix complicated Select
2015-08-01 11:49:34 +08:00
Jinzhu
f07216e90e
Allow pass blank string to Order
2015-08-01 11:31:36 +08:00
Jinzhu
85a682e820
Update README for AddForeignKey example
2015-08-01 11:28:31 +08:00
Jinzhu
393d8a3a52
Fix possible duplciated foreign key name
2015-08-01 11:27:01 +08:00
Jinzhu
05b3f036f8
Change plural engine to github.com/qor/inflection
2015-08-01 11:20:08 +08:00
Jinzhu
6f30170fec
Use copy logger into itself instead of using parent's
2015-08-01 11:12:39 +08:00