Commit Graph

2506 Commits

Author SHA1 Message Date
elgris fb09befb9b Adds processing of ignored fields on Update 2016-08-14 16:12:57 +08:00
Jinzhu 34e75afb42 Support specify count select argument 2016-08-14 15:15:09 +08:00
Jinzhu 8f0f5df8c6 Don't set auto increment primary key's HasDefaultValue to true 2016-08-13 21:46:49 +08:00
Jinzhu 294eb58fc2 Merge branch 'GhostRussia-fix_join_with_same_fields' 2016-08-13 21:23:25 +08:00
Jinzhu fde205f758 Refactor joining multiple tables with the same fields 2016-08-13 21:23:18 +08:00
zardak ccb35db934 Fix failing sqlite3 tests due to db connection not being closed 2016-08-13 21:05:24 +08:00
Nick Sarbicki 084968cc0a Fixing go get error
Get this on install:

    ../../jinzhu/gorm/utils.go:137: syntax error: unexpected range, expecting {
    ../../jinzhu/gorm/utils.go:147: non-declaration statement outside function body
    ../../jinzhu/gorm/utils.go:148: syntax error: unexpected }
2016-08-13 21:05:24 +08:00
Jinzhu 9cdda4e8ee Expose current database name API 2016-08-13 21:05:24 +08:00
Jinzhu dda88dd08c Merge pull request #1140 from zardak/fix-tests
Fix failing sqlite3 tests due to db connection not being closed
2016-08-11 10:59:00 +08:00
Vladislav Fursov e8c14bd1b3 Fixed a bug when joining multiple tables with the same fields and where on the same field. 2016-08-09 14:28:43 +09:00
zardak bcff1df589 Fix failing sqlite3 tests due to db connection not being closed 2016-08-07 13:00:06 +03:00
Jinzhu a646b13548 Merge pull request #1119 from NDevox/master
Fixes #1118
2016-07-20 08:36:53 +09:00
Nick Sarbicki d7fa7d0859 Fixing go get error
Get this on install:

    ../../jinzhu/gorm/utils.go:137: syntax error: unexpected range, expecting {
    ../../jinzhu/gorm/utils.go:147: non-declaration statement outside function body
    ../../jinzhu/gorm/utils.go:148: syntax error: unexpected }
2016-07-16 14:14:46 +01:00
Jinzhu b507cdf93d Expose current database name API 2016-07-11 21:37:44 +08:00
Jinzhu 613c065569 Merge branch 'RichardKnop-feature/fix-preload-duplicates' 2016-07-10 21:34:49 +08:00
Jinzhu ca46038cb4 Fix preload duplicates has many related objects 2016-07-10 21:34:37 +08:00
Richard Knop 24501a3c1a Fixed bug when preload duplicates has many related objects. 2016-07-09 18:51:38 +08:00
Jinzhu 3324ab2063 Merge pull request #1075 from cdevienne/fix_autoincrement
Fix autoincrement
2016-07-05 06:36:50 +08:00
Jinzhu c1c4f9f86e Add ORDER BY sql expression support 2016-06-28 11:15:42 +08:00
Jinzhu 321d10b67b Fix broken tests for postgres 2016-06-24 07:48:03 +08:00
Jay Taylor 1485f4bce9 Use validated interface{} for limit/offset values to ensure values greater than
max 32-bit integer are addressable, and in a backwards-compatible way.
2016-06-23 06:29:51 -07:00
Christophe de Vienne 328fe672c8 Test AUTO_INCREMENT only on postgres
Only the postgres dialect handles AUTO_INCREMENT on non-primary key.
So we skip the auto increment test for other dialects.

The mysql case is a little trickier because the simple presence of the
'AUTH_INCREMENT' tag produces a faulty 'CREATE TABLE' statement. Hence
we need to remove it when present.
2016-06-20 16:00:38 +02:00
Christophe de Vienne 608fd976c4 Fix auto_increment on postgres database. 2016-06-20 15:00:19 +02:00
Jinzhu caa792644c Include model value when preloading many2many relations to enable row query callbacks 2016-06-17 18:18:46 +08:00
Jinzhu 18917d1f3e Merge pull request #1028 from nkovacs/wercker
Wercker postgres and mysql
2016-06-16 18:29:11 +08:00
Jinzhu 6ef2a539bd Fix test 2016-06-16 18:18:00 +08:00
Jinzhu 61f50a429a Fix preload has one relations 2016-06-16 17:58:25 +08:00
Jinzhu 277b4e93b6 Merge pull request #1013 from girokon/m2m_preload_issue
fix m2m nested preload
2016-06-16 16:41:34 +08:00
Jinzhu cf3f9927ae Merge pull request #1072 from jinzhu/revert-1064-jay/limit-offset
Revert "Use int64 for limit/offset values to ensure values > 32-bit int are addressable."
2016-06-16 16:32:24 +08:00
Jinzhu f926dd9f9f Revert "Use int64 for limit/offset values to ensure values > 32-bit int are addressable." 2016-06-16 16:31:50 +08:00
Jinzhu 8117553fcb Merge pull request #1071 from thephred/multiple_indexes
Add support for multiple indexes seperated by commas for issue #884
2016-06-16 08:50:36 +08:00
Jinzhu 300edb5bca Merge pull request #1064 from jaytaylor/jay/limit-offset
Use int64 for limit/offset values to ensure values > 32-bit int are addressable.
2016-06-16 08:48:43 +08:00
Michael Goff e7f00bd2cd Add support for multiple indexes seperated by commas for issue #884 2016-06-15 16:06:22 -07:00
Jay Taylor 9b0fb2feb9 Use int64 for limit/offset values to ensure values greater than max 32-bit
integer are addressable.
2016-06-08 17:03:22 -07:00
Jinzhu bf0e236078 Fix get default value from blank primary field 2016-06-02 11:06:44 +08:00
Jinzhu dca5e54f8b Merge pull request #1038 from RichardKnop/bugfix/preload-panic
Fixed an occurrence of a panic while preloading non existent fields.
2016-06-01 23:10:28 +08:00
Jinzhu 09427a07b2 Merge pull request #1052 from stroborobo/fix-polymorphic-preload
Add support for polymorphic preload
2016-06-01 22:51:20 +08:00
Jinzhu 2631d6745c Merge pull request #1046 from andreynering/sqlite-testing-windows
Allow run tests for SQLite on Windows
2016-06-01 22:43:58 +08:00
Björn fcf8dd4e23 Add support for polymorphic preload
Fixes #1051
2016-06-01 13:46:45 +02:00
Andrey Nering 7248671c9a Allow run tests for SQLite on Windows 2016-05-28 13:49:32 -03:00
Richard Knop 8dfcab0f7f Fixed an occurence of a panic while preloading non existent fields. 2016-05-24 00:54:53 +08:00
Jinzhu 27522453de Merge pull request #1031 from nkovacs/add-foreign-key-panic-fix
fix panic in AddForeignKey on mysql dialect
2016-05-22 19:10:33 +08:00
Nikola Kovacs 7983fc6269 fix panic in AddForeignKey on mysql dialect 2016-05-22 09:58:37 +02:00
Jinzhu 4c9c024939 Merge pull request #1029 from nkovacs/mysql-foreign-key-length-fix
Mysql foreign key length fix
2016-05-22 08:00:40 +08:00
Nikola Kovacs 6fca4ec9fe Add wercker.yml with postgres and mysql tests 2016-05-22 01:59:25 +02:00
Nikola Kovacs 6eb73ae654 Fix too long foreign key names in mysql.
The dialect must define its own foreign key generator method.
The previous default is available as a method on gorm.DefaultForeignKeyNamer
and can be embedded in other dialects.
The mysql dialect uses the first 24 characters plus an sha1 hash of the
full key name if the key name is more than 64 characters.
2016-05-22 00:13:26 +02:00
Nikola Kovacs 58ce6153e2 don't test AddForeignKey on sqlite 2016-05-21 23:19:41 +02:00
Nikola Kovacs ed9cfac496 add failing test for long foreign keys in mysql 2016-05-21 19:12:02 +02:00
Igor Noskov 13ac0839c4 fix m2m nested preload 2016-05-12 14:48:08 +06:00
Jinzhu 57c72125b3 Merge pull request #1001 from stroborobo/assoc-error
association: dont execute Append/Replace/Delete if Error already present
2016-05-09 22:47:58 +08:00