Commit Graph

40 Commits

Author SHA1 Message Date
Marc Gravell b7d341eaaf investigate #2031 2024-02-23 09:38:44 +00:00
Ohorodniichuk Dmytro 8f369914ac Issue #1164 (#1795)
Fix unsigned types mapping arithmetic overflow
Add tests to reproduce issue #1164

Co-authored-by: Dmytro Ohorodniichuk <dmytro.ohorodniichuk@neogames.com>
2024-01-07 21:42:09 +00:00
Marc Gravell d7c16035d2 fix codegen error in value-type multimap #2005 (#2022)
in horizontal multi-map, don't "returnValueLocal = null" for value-types (invalid IL)
fix #2005
2024-01-02 15:32:04 +00:00
Marc Gravell c46c69a174 1. give clearer error messages when an ICustomQueryParameter is null (#2003)
2. provide a convenience .ctor on DbString
2023-11-23 08:58:18 +00:00
Marc Gravell 947b582c79 fix #1993 - when matching properties, prefer non-normalized property name (#1997) 2023-11-11 08:51:05 +00:00
Marc Gravell 6fdafc32e2 add commmit and rollback to "text" exclusion list (#1995) 2023-11-10 19:17:10 +00:00
Marc Gravell 2f56056a89 - expand auto-sproc detection to handle more scenarios and explicit exclusions (#1989)
- add net7 target
- use regex generator when available (net7+)
- fix #1984
2023-10-20 09:24:01 +01:00
Marc Gravell cdadfa6db6 whitespace for auto-SP detection: use unicode spec via regex (#1987)
* add fix and test for #1975

* wrong ticket number; is #1986
2023-10-19 12:25:11 +01:00
Giorgi Dalakishvili 19193b52bb Add a setting to turn off Ole Db "smell check" (#1974)
* Add a setting to turn off Ole Db "smell check"

* Rename setting, fix logic

* Test for SupportLegacyParameterTokens

* Fix exception type

* Add release note
2023-10-11 13:10:00 +01:00
Giorgi Dalakishvili 2837480903 Add DuckDB tests (#1970)
* Add DuckDB tests

* Update DuckDB.NET.Data.Full version
2023-10-11 12:41:06 +01:00
Marc Gravell a37b151bb7 auto-detect stored procedures as anything without whitespace (#1975)
* 1. auto-detect stored procedures as anything without whitespace
2. we have public fields? (hangs head in shame)

* release notes

* no need to use regex
2023-10-10 15:06:21 +01:00
Marc Gravell a4a55f5b79 assert that type handlers don't need object? (#1960)
* assert that type handlers don't need object? - include test to validate (plus: NRT check was happy)

fix #1959

* release notes
2023-09-13 21:43:13 +01:00
Marc Gravell 61ff85a2b8 add missing ReadUnbufferedAsync untyped API (#1958)
* - add missing ReadUnbufferedAsync untyped API
- remove an impossible branch

* release notes
2023-09-13 14:58:12 +01:00
Marc Gravell aecffecae1 attempt NRT makeover (#1928)
* attempt NRT makeover

- annotate NRTs on GridReader API
- add protected access to some of the GridReader internals
- switch GridReader callbacks to be more type-independent

docs

lib updates; deal with yellow warnings and test failures (SQL server certs and cancellation surfacing differently)

fix break

simplify proposed GridReader changes to protected OnBeforeGrid and OnAfterGrid[Async]

Builds: Bump library versions (#1935)

Tests: Upgrade dependencies for Dependabot (#1936)

I'll do a pass at all of these later, but getting CVE versions out of the pipe.

Resolving 4 alerts here: https://github.com/DapperLib/Dapper/security/dependabot

merge and lib updates

allow Identity to be constructed on-the-fly inside GridReader

fix build warnings

include readme

rev minor

- enable [SkipLocalsInit] everywhere
- use NET5_0_OR_GREATER
 for remoting check

# Conflicts:
#	Dapper/CommandDefinition.cs
#	Dapper/DefaultTypeMap.cs
#	Dapper/SqlMapper.Async.cs
#	Dapper/SqlMapper.IDataReader.cs
#	Dapper/SqlMapper.Link.cs
#	Dapper/SqlMapper.cs
#	Directory.Build.props

* shipped, not unshipped

* fixup SqlBuilder; use is null / is not null

* use central package management (#1949)

* Nullable test tweaks

* Nuget: let's just remove it!

* 2 test fixes from review

* fix FindExplicitConstructor

* add GetPropertySetterOrThrow

* fix NRT on FindConstructor

* DapperRow: value is object?

* use NotNullWhen

* make constructor problem more obvious

* test fixes

---------

Co-authored-by: Nick Craver <nrcraver@gmail.com>
2023-09-12 15:58:49 +01:00
Lehonti Ramos ff913be391 Removed block nesting levels in a few tests by using block-scoped using statements (#1939)
Co-authored-by: John Doe <john@doe>
2023-08-24 13:12:33 +01:00
Marc Gravell 33090c0218 Underscore handling (#1947)
* Adds MatchConstructorParametersWithUnderscores option

* generalize to single MatchNamesWithUnderscores (pre-existing)

* cite 2nd PR

---------

Co-authored-by: Jonas Goronczy <goronczy.jonas@gmail.com>
2023-08-17 17:30:34 +01:00
Nick Craver 136dc11f0c Tests: Upgrade dependencies for Dependabot (#1936)
I'll do a pass at all of these later, but getting CVE versions out of the pipe.

Resolving 4 alerts here: https://github.com/DapperLib/Dapper/security/dependabot
2023-07-08 11:43:58 -04:00
Marc Gravell 20d81380ca mark all structs as readonly; fix some compiler noise (no functional change) (#1925) 2023-06-20 13:33:43 +01:00
Marc Gravell d91d90465d reinstate support for IDataReader (#1913)
* if we stop supporting DbDataReader, someone is going to complain; I'd
rather wrap it for now (to make the lib work), and add an analyzer
in AOT that shouts at them for using IDbConnection

also: compiler nits

* release notes
2023-06-20 13:31:55 +01:00
Cédric Luthi 677fee27c6 Enable the Issue552_SignedUnsignedBooleans test (#1919)
It works fine with MySqlConnector 1.1.0
2023-06-13 17:11:13 +01:00
Cédric Luthi da6509a224 Document how to run docker for db tests (Firebird + MySQL + PostgreSQL) (#1918) 2023-06-13 17:06:30 +01:00
Marc Gravell d56340b885 add missing QueryUnbufferedAsync<T> API (#1912)
* impl QueryUnbufferedAsync<T>
* implement GridReader.ReadUnbufferedAsync<T>
2023-06-09 16:22:25 +01:00
Marc Gravell 01f03ef3e8 add support for fetching values via GetFieldValue<T> (#1910)
add support for fetching values via GetFieldValue<T>; this requires
DbDataReader, but in reality the reader is *always* DbDataReader;
acknowledge this, and stop pretending to use IDataReader internally
(no breaks to public API)
2023-06-09 14:02:06 +01:00
Olivier Spinelli 70be2bd5e2 Fixed case sensitivity issues. (#1801) 2022-08-21 13:27:09 -04:00
mgravell 3d405fea35 add type hint 2021-11-11 14:14:25 +00:00
mgravell 21ce60b523 move tests to npgsql 6 (GA); better datetime coverage 2021-11-11 14:05:48 +00:00
Marc Gravell b272cc664d Don't specify dbtype for DateTime et al; fixed npgsql 6 issue (#1723)
* context: #1716 https://github.com/DapperLib/Dapper/issues/1716

- change type-map to allow nullable
- change DateTime/TimeSpan to null
- do not specify DbType for null
- semi-breaking change: swap GetDbType to SetDbType, noting that it is marked [Obsolete] and internal-use-only
- semi-breaking change: make LookupDbType return nullable (same internal-use/[Obsolete])

* add test for Npgsql 6.0.0-rc.1

* try list parameters (like arrays)

* never assign -1 (sentinel) as the .DbType

* postgres tests
2021-11-03 14:01:15 +00:00
Marc Gravell 4aac41a2bc Enables "snowflake" connection (#1689)
* snowflake tests #1687

* actually add the tests!
2021-07-27 09:11:16 +01:00
Nick Craver 2b7b3fe4a9 Merge pull request #1575 from zqlovejyc/main 2021-05-10 08:58:31 -04:00
Nick Craver 600c1aca45 Add test cases and cleanup last call site.
This merges in the work in #1663 and cleans up the convert a bit further.
2021-05-09 23:10:31 -04:00
Nick Craver 566d169a26 Add DbString.ToString() overload
Fixes #1538 and #1545 by making DbString.ToString() much more descriptive.
2021-05-09 22:36:23 -04:00
Nick Craver fca49ebcce SplitOn: improve error message
Fixes #866. This provides a more informative error, saying _which_ splitOn column couldn't be found in the result set.
2021-05-09 21:51:20 -04:00
Nick Craver a12c37adcd Merge pull request #1598 from DarkWanderer/feature/support-returning-arrays 2021-05-09 08:08:41 -05:00
Nick Craver 3387019402 Merge remote-tracking branch 'origin/main' into pr/952 2021-05-09 08:41:35 -04:00
mgravell e26aa7b2d6 fix #1656 (git reorg) 2021-04-29 11:04:12 +01:00
DarkWanderer 55b10233f1 Removed accidental namespace addition, made test name clearer 2020-12-20 11:13:12 +03:00
DarkWanderer f724638c20 Add PostgreSQL test for array 2020-12-20 11:13:12 +03:00
Marc Gravell 6ab170c160 .Net 5 (#1572)
* initial net5.0 tweaks; also fix current IDE warnings

* lib updates and fixes

* more cleanup

* fix snafu

* skip locals init

* disable xunit shadow copy in tests

* test records

* explore scenario that currently works re #1571
2020-11-17 09:57:17 +00:00
Nick Craver 1c4f33d665 Fix TestMultiSelectWithSomeEmptyGrids on *nix 2020-10-22 20:59:16 -04:00
Nick Craver 78ed4b2077 Tests: move into folders
One of several moves to make this something we can dev on all platforms and build on Actions for v3 onwards.
2020-10-11 14:56:35 -04:00