Commit Graph

96 Commits

Author SHA1 Message Date
Jinzhu e5432b14d2 Add QueryExpr, thanks @ManReinsp for PR #1548 2017-08-11 18:41:04 +08:00
Jinzhu 5730b92954 Fix tests with mssql 2017-03-22 23:50:42 +08:00
Jinzhu 403487d5dd Setup mssql test env 2017-03-22 23:50:42 +08:00
Jinzhu c730b30a78 Fix "Unsupported destination" error when value is pointer of pointer 2017-02-07 08:32:18 +08:00
slockij e26cb8dbc4 In some cases (Error not checked, missed data) one can perform very harmful operation - global update or delete (all records)
This is to prevent it.
2016-11-04 17:54:43 +01:00
Jinzhu c1b9cf186e Merge pull request #1210 from baijum/error-zero-args
If no arguments, return error at once
2016-10-23 22:58:23 +08:00
Jinzhu 89b7cbe89c Fix RowsAffected not returned for FirstOrCreate 2016-10-21 11:30:17 +08:00
Jinzhu 5d853fc53c Fix null time not allowed in mysql5.7 test error 2016-10-19 12:20:45 +08:00
Baiju Muthukadan bd513dd580 test case for single parameter for Open 2016-10-08 21:52:15 +05:30
Jinzhu 02f6ae3c4e If failed to update current record with Save, try to create a new one 2016-09-07 21:54:19 +08:00
zardak ccb35db934 Fix failing sqlite3 tests due to db connection not being closed 2016-08-13 21:05:24 +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
Jinzhu 18917d1f3e Merge pull request #1028 from nkovacs/wercker
Wercker postgres and mysql
2016-06-16 18:29:11 +08:00
Andrey Nering 7248671c9a Allow run tests for SQLite on Windows 2016-05-28 13:49:32 -03:00
Nikola Kovacs 6fca4ec9fe Add wercker.yml with postgres and mysql tests 2016-05-22 01:59:25 +02:00
Jinzhu 7c43d9fc36 Fix scan columns with same name 2016-03-10 17:35:19 +08:00
Jinzhu d08894cd69 Rename test files 2016-03-08 22:00:15 +08:00
Jinzhu ec110657da Refactor based on golint 2016-03-07 17:49:55 +08:00
Jinzhu c811590d4e Add dialects for supported databases for easier to use 2016-03-05 18:54:59 +08:00
Jinzhu f57198fe97 Test multiple Joins 2016-02-21 10:55:36 +08:00
Jinzhu 115789960a Joins support parameters, close #673 2016-02-16 22:48:26 +08:00
Jinzhu 6546ec3b5e Scan Rows into struct, fix #59 2016-02-14 23:29:06 +08:00
Jinzhu 86b4b20278 Merge branch 'master' into v1.0_dev 2016-02-14 14:18:35 +08:00
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
Jinzhu 8d716be896 Fix some go vet/lint reports 2016-01-15 21:16:48 +08:00
Jinzhu f0364a0fb5 Merge branch 'master' into v1.0_dev 2016-01-12 15:47:50 +08:00
Jinzhu 801a271d07 Fix Association Count 2016-01-12 12:31:05 +08:00
Jinzhu f574429f5e Return pointer when Open 2016-01-10 21:26:55 +08:00
Jinzhu ec0aa10bf2 Fix set scanner to a Field 2016-01-04 21:49:04 +08:00
Jinzhu d1892d3177 Support poiner of Scanner 2016-01-04 18:42:47 +08:00
Jinzhu eeb9ba2250 Fix query with Joins 2015-10-01 07:43:43 +08:00
Jinzhu e1ce3b7066 Merge branch 'jaytaylor-jay/ddl-errors' 2015-08-13 09:09:37 +08:00
Jinzhu 1d4f908ea2 Fixed detecting pointers as a Scanner. thanks @NOX73 2015-08-12 22:28:01 +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
Jinzhu 58f379b098 Add auto migration 2015-06-01 11:17:51 +08:00
Jinzhu 331d8ceabd Don't overwrite primary key if already it is already exist 2015-06-01 11:09:58 +08:00
Jay Taylor dcc06e22f7 FoundationDB dialect layer and compatibility updates. 2015-03-24 10:35:19 -07:00
Jinzhu ad251b9deb Create with Select 2015-03-12 17:47:31 +08:00
Jinzhu 4e8d43dd4f Refactor check HasTable, HasColumn 2015-02-28 17:01:27 +08:00
Jinzhu 73b6f0eace Linting according to golint 2015-02-17 08:34:01 +08:00
Jinzhu a4e0ef6509 Refactor reuse existing database connection 2014-11-25 15:21:28 +08:00
jnfeinstein 1d6b59f223 Allow .Open to reuse existing database connections.
This commit allows you to pass a string or an existing database
connection as the source for gorm. The dialect is still required
because a) there is no common reference to it as far as i know, and
b) gorm allows the dialect to differ from the driver. So, for the sake
of simplicity, you still have to specity the dialect.

This is useful if you have an existing transaction, but still
want to use gorm to format your queries.

This is dependent on the defintion of DB in pkg database/sql having
the field 'dsn', which is the database source, obtained via reflect.
2014-11-25 15:21:28 +08:00
Paolo Galeone 064d91335b Add default values support ( https://github.com/jinzhu/gorm/issues/251 ) 2014-11-15 18:32:35 +01:00
Jinzhu 5eeff5d38f Fix some errors for the mssql support pull request 2014-09-19 21:49:04 +08:00
Joel Trost a6b243a3e9 fix for bad rebase 2014-09-16 14:49:29 -07:00
Joel Trost 6b7d0879c5 Ran gofmt and removed panic statements
Unnecessary panics in create_test and delete_test removed
2014-09-16 14:24:55 -07:00
Joel Trost f79e1a2ef6 GORM support for MSSQL, passes all tests 2014-09-16 14:21:35 -07:00
Jinzhu e9ecf9c1aa Fix HasTable tests 2014-08-30 21:43:52 +08:00
Robert B Gordon bc616fafbf Fix the HasTable test, for real. 2014-08-29 09:53:12 -05:00
Jinzhu 43be73504f Merge pull request #210 from rbg/master
HasTable Test should clean up.
2014-08-29 22:30:19 +08:00