Ian Tan
7aa08b9014
Refactor code for extracting has_many relations
2017-11-21 19:32:17 +08:00
Ian Tan
b06542dc77
Support preloading
2017-11-21 19:02:54 +08:00
Ian Tan
da8c7c1802
Add noop db driver
2017-11-21 17:10:10 +08:00
Ian Tan
486fb73ee5
Add documentation to prevent go lint from complaining
2017-11-21 12:26:18 +08:00
Ian Tan
e9a29091fa
Clean up debug code
2017-11-20 18:41:06 +08:00
Ian Tan
afe269ec7d
Support slice value -> sql.Rows
2017-11-20 18:38:57 +08:00
Ian Tan
b4591d4db8
Add naive get rows function
2017-11-20 16:04:38 +08:00
Ian Tan
a4ba25028d
Add Value() method to gorm_test.Num to prevent scan error
2017-11-20 16:02:40 +08:00
Ian Tan
62740e8e1e
Add docs
2017-11-20 10:25:12 +08:00
Ian Tan
8c06f3ff4f
Fix variadic arguments
2017-11-18 21:23:55 +08:00
Ian Tan
6a1b81b18b
Escape query string and assert err == nil
2017-11-18 19:24:45 +08:00
Ian Tan
ae219db84b
Add method to assert all expectations
2017-11-18 19:11:21 +08:00
Ian Tan
475ba3db3e
Proof of concept using DB.logger
2017-11-18 19:06:00 +08:00
Ian Tan
5520530799
Fix some go lint errors
2017-11-18 16:37:14 +08:00
Ian Tan
90528be927
Implement private clone method to support fluent API
2017-11-17 18:29:31 +08:00
Ian Tan
b9fc77cb77
Rename files
2017-11-17 17:24:57 +08:00
Ian Tan
5505f2ee76
Remove asserter interface
2017-11-17 17:24:35 +08:00
Ian Tan
27ec78afaa
Remove Asserter interface and combine its functionality into Adapter
2017-11-17 17:20:42 +08:00
Ian Tan
71174be05a
Rename TestHelper to Expecter and simplify factory function(s)
2017-11-17 17:19:49 +08:00
Ian Tan
36170724dd
Refactor mock connection open/close logic
2017-11-17 12:29:06 +08:00
Ian Tan
f5319a00fa
Add NewDefaultTestHelper func
2017-11-17 12:10:24 +08:00
Ian Tan
c3e927ba8b
Reorganise code structure
2017-11-17 11:55:19 +08:00
Ian Tan
eb418da347
Use github.com/jinzhu/gorm
2017-11-17 11:44:56 +08:00
Ian Tan
85b621bf4e
Use same helper and mockDb
2017-11-16 18:54:14 +08:00
Ian Tan
7b6f227136
Add Close method to TestHelper
2017-11-16 18:53:54 +08:00
Ian Tan
fb65f6708c
Groundwork for TestHelper
2017-11-16 18:40:49 +08:00
Aetheus
0a51f6cdc5
add JSONB type ( #1626 )
...
* add JSONB type
* add comments to satisfy gofmt
2017-10-10 08:28:39 -05:00
Konrad Kleine
9c9de89686
Use log.PrintX instead of fmt.PrintX ( #1634 )
2017-10-10 08:04:23 -05:00
Horacio Duran
3a9e91ab37
Correct ModifyColumn SQL syntax. ( #1614 )
...
* Correct ModifyColumn SQL syntax.
The generated SQL for ModifyColumn was:
`ALTER TABLE "tablename" MODIFY "columname" type`
But should have been:
`ALTER TABLE "tablename" ALTER COLUMN "columname" TYPE type`
since Modify does not seem to be entirely compatible with all Engines
* Test ModifyColumn
* Skip ModifyColumnType test on incompatible DBs
Some DB Engines don't fully support alter table so we skip
when the dialect does not correspond to one of the ones that
are known to support it.
2017-09-28 22:48:21 +08:00
Cedric GESTES
b1885a643b
Support cloudsqlpostgres dialect ( #1577 )
...
This is needed for proper cloud sql proxy.
see https://github.com/GoogleCloudPlatform/cloudsql-proxy and https://github.com/GoogleCloudPlatform/cloudsql-proxy/blob/master/proxy/dialers/postgres/hook_test.go for details.
2017-09-04 22:39:19 +08:00
Domen Ipavec
c0ac6a7d50
Do not ignore order on distinct query ( #1570 )
2017-09-04 22:35:37 +08:00
Teppei Fukuda
6e456250f7
Erros skip nil in Add function ( #1566 )
2017-09-04 22:25:57 +08:00
Dhiver
981d5db663
Fix postgres dialect UUID sqlType evaluation ( #1564 )
2017-09-04 22:23:42 +08:00
Lukas Dietrich
750fd9030a
Fix postgres dialect for dbs with multiple schemas ( #1558 )
...
If a postgres database contains more than one
schema methods like HasTable(...) would return
true even if the current schema does not contain a
table with that name.
2017-09-04 22:22:02 +08:00
Jinzhu
c3bb6aaa82
Fix QueryExpr tests
2017-08-11 23:24:00 +08:00
Jinzhu
e5432b14d2
Add QueryExpr, thanks @ManReinsp for PR #1548
2017-08-11 18:41:04 +08:00
Jinzhu
d61b7db8fa
Fix postgres tests
2017-08-11 18:03:32 +08:00
Jinzhu
969ab67636
[mssql] Fix save time struct's timezone
2017-08-11 17:18:49 +08:00
Kyle Spraggs
6f64b8610d
Update callback_query_preload.go ( #1553 )
2017-08-02 07:05:11 +08:00
Jinzhu
35fb16eeba
Don't overwrite existing timestamp when creating
2017-07-31 17:26:36 +08:00
Ivan Valkov
5b8c0dd6b9
Changed the type of uint32 from integer to bigint in postgres ( #1536 )
...
The integer type in postgres is 4 bytes. Since it is also signed, when using uint32 with high bit set you will get:
`pq: value "2854263694" is out of range for type integer`
To prevent this uint32 should be bigint in postgres.
2017-07-23 16:05:43 +08:00
liu-xuewen
10e217e2bc
Print affected rows ( #1541 )
...
* fix better
* add the rows number that the sql result affected or returned
2017-07-23 16:04:22 +08:00
Ivan Valkov
2a1463811e
Allow use number as column name ( #1517 )
...
* Updated scope.go to always quote when adding index
I am using numbers for column names (to be compatible with protobuf) and adding unique index to them does not work since they are not quoted. I do not see a reason to check if the column name is a string in order to quote it. Correct me if I am wrong.
* Updated the columnRegexp to include decimals
* Update scope.go
2017-07-03 21:49:54 +08:00
Jinzhu
d510c7e4b8
mysql only accept offset with limit together
2017-07-03 11:58:01 +08:00
Jinzhu
d395b35025
mysql only accept offset with limit together
2017-07-03 11:26:31 +08:00
Jinzhu
eae7f6be60
Fix source type is incorrect error for embedded many to many relationship
2017-06-14 17:33:21 +08:00
Jinzhu
9acaa33324
Merge pull request #1451 from ModelRocket/master
...
gorm:auto_preload setting to enable auto preloading associations
2017-05-04 22:08:37 +08:00
Rob Rodriguez
e470b44fa8
adding gorm:auto_preload option and related tests
2017-04-27 15:53:39 -07:00
Jinzhu
717654b31c
Merge pull request #1420 from ModelRocket/master
...
Adding more complete binary support for standard dialects
2017-04-19 15:35:50 +08:00
Rob Rodriguez
bae0799bd8
Adding better binary type support for common SQL dialects
2017-04-19 00:21:56 -07:00