Benjamin Rupp
4567d0a670
Adjusting < go 1.8 implementation
2019-09-25 09:25:15 -04:00
Benjamin Rupp
327ae5dcb6
Fix for mocking Exec with custom []string datatype
2019-09-25 09:13:06 -04:00
Benjamin Rupp
6099e2fbb4
Adding unit tests for Query/Scan and Exec mocking, using custom []string data type
2019-09-25 09:11:30 -04:00
Gediminas Morkevicius
e98392b811
Merge pull request #177 from dackroyd/invalidate-sql-rawbytes-memory
...
Invalidate memory scanned into sql.RawBytes
2019-06-21 13:39:28 +03:00
David Ackroyd
d5879ee4b7
Invalidate memory scanned into sql.RawBytes
...
The intention of sql.RawBytes is for it to hold memory owned by the
database. When used, it's content is only valid until the `Next`,
`Scan` or `Close` is called on the `Rows`
To ensure that we meet this behaviour, when `[]byte` is used in a
column, it's value is copied to a buffer that we keep track of for
later invalidation. By doing this, incorrect use of `sql.RawBytes`
values is exposed in tests that use go-sqlmock. Without this, when a
real database is used and it's driver does share memory, then those
issues would not be exposed until runtime (and in non-obvious ways)
2019-06-21 17:03:05 +10:00
gedi
6c8a572d09
for some reason transaction statement was not working on go1.8
2019-06-07 09:38:57 +03:00
gedi
4ee1fdaf44
closes #159
2019-06-07 09:26:40 +03:00
Gediminas Morkevicius
7500ecac5e
Merge pull request #174 from krevels/out_parameter_support
...
Out parameter support
2019-06-05 09:30:04 +03:00
Kyril Revels
470c520119
formatting
2019-06-04 17:59:34 -04:00
Kyril Revels
1dd355d63c
support for usage of sql.Out as a param value
2019-06-04 17:57:33 -04:00
Gediminas Morkevicius
ef0bdf231a
Merge pull request #167 from sekky0905/remove-travis-sudo-setting
...
Remove sudo setting from travis.yml
2019-03-22 16:25:48 +02:00
sekky0905
9daf2407ed
Remove sudo setting from travis.yml
2019-03-22 21:58:17 +09:00
Gediminas Morkevicius
3f9954f6f6
Merge pull request #164 from theodesp/examples/go-sql-driver-imports
...
Examples/go sql driver imports
v1.3.3
2019-03-01 16:57:32 +02:00
Theo
314ebd6022
Reverted back example imports
2019-02-28 18:29:25 +00:00
Gediminas Morkevicius
c05e0c0b97
Merge pull request #165 from theodesp/typo-fixes
...
Fixed some typos
2019-02-28 13:00:43 +02:00
Theo
26446431a0
Typos again.
2019-02-28 10:47:32 +00:00
Theo
882c1d1daa
Fixed some typos
2019-02-27 19:44:03 +00:00
Theo
7b89f04a98
Restored Readme section format
2019-02-27 17:09:09 +00:00
Theo
05afef726f
Add go-sql-driver imports to make it easier to run the examples
2019-02-27 17:04:14 +00:00
Gediminas Morkevicius
7f7699b45e
Merge pull request #162 from midnightrun/master
...
Update expectations.go
2019-02-18 20:17:19 +00:00
Camal Cakar
b03ef5f2a4
Update expectations.go
...
Case sensitivity update for comments.
2019-02-18 18:42:21 +01:00
gedi
dfdf60c043
update travis config
2019-02-13 09:34:40 +02:00
gedi
08cb21bb55
closes #161 removes references to gopkg.in
2019-02-13 09:29:47 +02:00
gedi
472e287dba
fixes the go module name
v1.3.2
2019-02-12 15:25:38 +02:00
gedi
4076b744ea
add go.mod, closes #160
v1.3.1
2019-02-12 14:31:14 +02:00
Gediminas Morkevicius
2a5889fc86
Merge pull request #151 from darwish/master
...
adds missing lock around e.fulfilled() in ExpectationsWereMet()
2018-12-21 10:51:09 +02:00
Michael Darwish
e671f177c0
adds missing lock around e.fulfilled() in ExpectationsWereMet()
2018-12-20 13:00:51 -05:00
gedi
f7b0b9305b
closes #114 allow expecting rows to be closed
2018-12-11 17:38:12 +02:00
gedi
a6e6646ad9
use configured QueryMatcher in order to match expected SQL to actual, closes #70
2018-12-11 15:20:44 +02:00
gedi
2a15d9c09b
add QueryMatcher interface for customizing SQL matching
2018-12-11 14:22:16 +02:00
Gediminas Morkevicius
e4e10ddf73
Merge pull request #147 from gliptak/gofmt1
...
Gofmt sqlmock_test.go
2018-10-21 23:12:15 +03:00
Gábor Lipták
c6bf1c0f76
Gofmt sqlmock_test.go
...
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2018-10-20 15:47:49 -04:00
Gediminas Morkevicius
d4b2bccf3e
Merge pull request #134 from nineinchnick/custom-converter
...
Allow to use a custom converter
2018-09-14 13:42:08 +03:00
Jan Was
168056e96a
move options to a separate file
2018-09-14 11:03:24 +02:00
gedi
4eed5ba1a0
add latest go version to travis build
2018-09-08 19:12:32 +03:00
Jan Waś
3cbf32d5e7
more tests
2018-08-06 23:07:17 +02:00
Jan Waś
298bfde310
add tests
2018-08-06 22:59:44 +02:00
Jan Waś
aaceb21fbd
use custom converter only in newer go
2018-08-06 22:49:41 +02:00
Jan Waś
3d31483014
add comment to CheckNamedValue
2018-08-06 22:41:15 +02:00
Jan Waś
f2bc8f904e
allow to use a custom converter
2018-08-06 22:29:24 +02:00
gedi
c8e01dc244
custom driver value mocking #131
2018-08-03 22:46:48 +03:00
Gediminas Morkevicius
852fc940e4
Merge pull request #129 from dolmen/apply-ParameterConverter-on-Row-values
...
Apply parameter converter on row values
2018-07-20 11:32:39 +03:00
Olivier Mengué
92e5f46c1c
tests/NullInt.Scan: remove support for int{,8,16,32}
...
Those types are not driver.Value, but int was necessary because sqlmock
was not properly using pure driver.Value before. Now that I fixed the
issue in previous commit, we can remove the old hack.
2018-07-12 16:03:36 +02:00
Olivier Mengué
896b89a023
Rows.AddRow(): enforce conversion to driver.Value when building row
2018-07-12 15:54:57 +02:00
Gediminas Morkevicius
4d2035c879
Merge pull request #128 from dolmen/improve-Travis-CI
...
Use gopkg.in import path for Travis and examples
2018-07-12 16:15:28 +03:00
Gediminas Morkevicius
5e7c2fba63
Merge pull request #127 from dolmen/fix-test-NullInt
...
testsuite: fixes in NullInt/NullTime
2018-07-12 16:08:31 +03:00
Olivier Mengué
5c0fec018b
tests/NullInt.Scan: add FIXME about removing int{,8,16,32} input support
...
The input of Scan is a driver.Value. Which means the only integer type
on input is a int64. But NullInt.Scan also handles int/int8/int16/int32
while that should not be necessary.
Unfortunately, sqlmock doesn't enforce strict driver.Value in its
implementation and the testsuite (that uses NullInt) relies on this bug.
So, this patch just adds a FIXME until sqlmock internals and testsuite
are fixed (will maybe require breaking the API).
2018-07-12 15:00:04 +02:00
Olivier Mengué
87bbc72050
tests/Null{Int,Time}: do not change the value in case of error
...
Do not touch the existing value in case of error.
No capital on error message.
2018-07-12 15:00:04 +02:00
Olivier Mengué
9119b1dbff
tests/Null{Int,Time}: refactor Scan for less lines of code
...
Single switch for all cases.
Single return for the success case.
2018-07-12 15:00:04 +02:00
Olivier Mengué
f974ac3c0c
tests/NullInt: fix Value() to return a valid driver.Value
...
Value must return int64, not int.
2018-07-12 15:00:04 +02:00