Commit Graph

137 Commits

Author SHA1 Message Date
Richard Knop f73f7b251f HasTable now works with table name passed as a string.
Before, only HasTable(&Foo) would work but HasTable("foos") would always
return false. This PR fixes that.
2016-02-13 20:28:42 +08:00
shenli 499b5b7615 scope: Catch error for db.Commit() 2016-01-04 13:32:35 +08:00
Jinzhu 92e0809716 Don't save associations if has any error happened 2015-08-18 11:09:03 +08:00
Jinzhu 018a7e69ec Handle DB error in callbacks 2015-08-17 16:38:01 +08:00
Jinzhu 309740983e Add Errors 2015-08-14 11:04:05 +08:00
Jinzhu 1a07673e97 Fix can't call callbacks for embedded pointers 2015-08-10 12:51:12 +08:00
Jinzhu fd9e42655f Handle children db's Error in callbacks 2015-08-07 16:35:48 +08:00
Jinzhu 8a88d665d5 Add QuoteIfPossible for Scope 2015-08-01 09:25:06 +08:00
Jay Taylor 923ca15b6f Surface errors emitted by `RowsAffected'. 2015-07-02 12:06:06 -07:00
Jinzhu 5ddca7c427 Fix table name for association 2015-06-30 10:39:29 +08:00
Jinzhu 308c96ee4c Add PrimaryFields 2015-06-29 18:04:15 +08:00
Jinzhu 0b8c9f29a9 Find Field by db name also 2015-06-04 12:10:14 +08:00
Jinzhu b96ca76e59 Set table name handler 2015-05-27 12:19:48 +08:00
Jinzhu dc55c59b84 Fix use SQL as table name 2015-05-19 10:43:32 +08:00
Jinzhu 5af077cd2d Handle []string for Select 2015-05-11 15:17:35 +08:00
Jinzhu 055bf79f8b Don't call method if value is nil 2015-04-21 11:24:48 +08:00
li3p f9bd6bcc64 look up the Field.Name at Scope.SetColumn 2015-04-16 14:28:55 +08:00
li3p 7966cde514 look up the Field.Name at Scope.SetColumn 2015-04-16 14:08:13 +08:00
Jinzhu e2eef50fb4 Add SetTableNameHandler 2015-04-08 14:56:03 +08:00
Jinzhu b9a39be9c5 Add Tabler 2015-04-08 11:36:01 +08:00
Jay Taylor ab48cd222a `UpdateColumns(...)` no longer triggers save of associated records. 2015-03-28 14:15:12 -07:00
Jinzhu 2989e42d4d Support UpdateColumn with Select and Omit 2015-03-13 11:01:05 +08:00
Jinzhu 187eae8d9c Update with Select and Omit 2015-03-12 18:30:59 +08:00
Jinzhu ad251b9deb Create with Select 2015-03-12 17:47:31 +08:00
Jinzhu 6e5d46bf37 Refactor Search API 2015-03-12 14:47:07 +08:00
Jinzhu 49454839bd Support Multi primary keys 2015-03-11 11:28:30 +08:00
Jinzhu 33e6b14632 Clear value from db after set table name 2015-02-26 16:08:26 +08:00
Jinzhu ce72988e96 Refactoring API for plugin system 2015-02-26 14:40:30 +08:00
Jinzhu 10340e6ad7 Support SQL expression 2015-02-24 22:06:35 +08:00
Jinzhu 0f08058713 Fix quote table name with database 2015-02-24 18:02:22 +08:00
Jinzhu 83ee11e184 Don't call callbacks if has error 2015-02-24 16:28:15 +08:00
Jinzhu 406a01875c Test using pointer as struct fields 2015-02-20 22:06:49 +08:00
Jinzhu 5c478b46e1 Use Common Initialisms from golint 2015-02-18 10:36:32 +08:00
Jinzhu 672ba4ffc9 Rename ToSnake to ToDBColumnName 2015-02-18 09:26:35 +08:00
Jinzhu 9b355ee86c Fix Associations with slice of pointer 2015-02-17 23:36:23 +08:00
Jinzhu 0b32041135 Review and Refactor 2015-02-17 22:55:14 +08:00
Jinzhu a38f83527a Fix all tests 2015-02-17 18:37:47 +08:00
Jinzhu d6439f4147 Fix tests after refactor 2015-02-17 18:01:24 +08:00
Jinzhu 803343fbe5 Fix scope.getField 2015-02-17 14:30:37 +08:00
Jinzhu 139b9a37e7 Merge branch 'master' into refactor 2015-02-17 08:38:32 +08:00
Jinzhu 73b6f0eace Linting according to golint 2015-02-17 08:34:01 +08:00
Andrew Martin 52775992ec golinting 2015-02-17 10:15:34 +11:00
Jinzhu de3f2a5c46 Refactor Fields 2015-02-16 17:47:07 +08:00
Jinzhu 3a73206010 Refactor model struct 2015-02-16 16:35:26 +08:00
Jinzhu 5d692a6bf2 Try to cache struct fields 2015-02-15 23:01:09 +08:00
Jinzhu 87b23edd3b Fix get PrimaryKeyField with embedded struct 2015-02-11 18:10:59 +08:00
Jinzhu aac52fdcf8 Fix Preload with slice of pointer 2015-02-11 17:58:19 +08:00
deoxxa d3ffcfab40 check for IsScanner on slices 2015-01-30 21:25:11 +11:00
Jinzhu 3e9c2d581f Fix duplicated instanceId in edge case 2015-01-26 17:59:31 +08:00
Jinzhu e2c989be17 Remove unnecessary IsIgnored check 2015-01-23 09:04:07 +08:00