1
0
mirror of https://github.com/DATA-DOG/go-sqlmock.git synced 2025-02-19 19:00:11 +02:00

22 Commits

Author SHA1 Message Date
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
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
gedi
f7b0b9305b
closes #114 allow expecting rows to be closed 2018-12-11 17:38:12 +02:00
Jan Waś
f2bc8f904e allow to use a custom converter 2018-08-06 22:29:24 +02:00
Olivier Mengué
896b89a023 Rows.AddRow(): enforce conversion to driver.Value when building row 2018-07-12 15:54:57 +02:00
gedi
18ab7ac1c7
improves error messages, closes #77 2017-04-26 09:56:38 +03:00
gedi
a00b6aa80e asserts ordinal argument position, fixes expected query error message 2017-02-16 22:33:12 +02:00
gedi
128bf5c539 implements next rows result set support 2017-02-08 17:35:32 +02:00
gedi
5a740a6373 rows scan error mocking test 2015-08-28 10:26:42 +03:00
gedi
acfbd5d998 allow null values from csv string to be converted to nil 2015-08-28 10:26:42 +03:00
gedi
dc0efdab8f allow to set errors for rows scan
* 9a36c2e more examples and tests for rows
* 908877e cannot mock rows.Columns error so far
2015-08-28 10:25:49 +03:00
gedi
a071483cba concurrency support, closes #20 and closes #9 and closes #15
* c600769 do not require a connection name, unique dsn is generated
* 1b20b9c update travis
* 1097b6a add comments for godoc documentation
* c142a95 fix golint reported issues
2015-08-28 10:25:20 +03:00
gedi
efe94c317b compose Rows interface with sql driver.Rows 2014-02-14 17:12:48 +02:00
gedi
bdba0bb0c6 Rows interface to allow building rows in different ways 2014-02-14 00:14:32 +02:00
Hebo
517a41ff43 Allow for multiple rows by manually creating each row 2014-02-13 11:59:35 -08:00
Hebo
936255418e Create a single row from an interface list - #1 2014-02-12 17:07:30 -08:00
gedi
c33b881467 documentation update based on lint 2014-02-08 17:53:15 +02:00
gedi
6f1be66c43 update package for godoc 2014-02-07 10:44:41 +02:00
gedi
ee2ed8f2d5 add doc blocks, split files 2014-02-07 10:02:57 +02:00
gedi
2fc5a0dd15 add readme and update error messages 2014-02-06 17:03:46 +02:00
gedi
3e67393335 initial commit 2014-02-05 16:21:07 +02:00