132 Commits
Author SHA1 Message Date
mgravell 522bc49a99 rev Microsoft.Data.SqlClient to GA (1.0.19239.1) 2019-08-28 17:09:18 +01:00
Marc Gravell 8152f2c718 WIP: Lib updates and prepare for Microsoft.Data.SqlClient (#1313)
v2 work; primarily prep for split SqlClient
2019-08-28 15:07:32 +01:00
Andrés 4eeb632fd5 Fixed issue #569 with IN and other condition. (#1146) 2019-08-27 17:03:49 +01:00
Joseph Musser 8b49eb691d Stop setting current index local which is nonexistent in ValueTuple deserializer (#1280)
* String and byte[] tuple elements cause InvalidProgramException

* Stop setting current index local which is nonexistent in ValueTuple deserializer
2019-06-13 07:37:41 +01:00
mgravell fcd8a70279 reinstate SqlDataRecord types (major conflict with MSSQLCLIENT, but that is removed for now) 2019-06-12 19:39:12 +01:00
Marc Gravell 9fbba78da0 Make Dapper happy with Microsoft.Data.SqlClient (#1262)
* prep work for adding Microsoft.Data.SqlClient support/tests; SqlClient dependency is not yet removed
2019-06-12 16:24:38 +01:00
Joseph Musser 33d974a5c0 Fixes mapping for C# tuples with more than seven elements (#1242)
* Failing tests for tuples larger than 7

* Special-case IL generation for ValueTuple

* Make value-processing logic available to ValueTuple generation
2019-06-12 16:16:45 +01:00
Marc Gravell d19d6012e7 fix #1228 - rev sqlclient to 4.6.0 (#1229)
* fix #1228 - rev sqlclient to 4.6.0
* use transitive deps for SqlClient
2019-04-05 11:39:04 +01:00
Nigel 733d1734ca When reading Geometry and Geography values from the database, we need to specify the SRID explicitly to retain it in the DbGeometry / DbGeography type. (#1038)
merging, thanks, and sorry for delay
2019-03-27 09:18:05 +00:00
Andrew Sumido ec194429cd Corrected class name from PostcresqlTests to PostgresqlTests (#1144) 2018-11-01 20:56:06 -04:00
David Glassborow 5189fcd43a Tests for #1111 - Inconsistent deserialisation between normal Query<T> and SqlMapper.Parse<T> 2018-09-06 20:33:27 -04:00
Nick Craver 522d150e25 Faster builds + use MySqlConnector
MySql.Data is a travesty at this point - moving to something more stable. Really we weren't testing Dapper with previous test failures, we were testing what mood MySql.Data and NuGet extraction are in and which phase of the moon is about.

Also speeds up the builds with 1 restore and 1 build. We can simplify here because everything is relevant (no wasted builds).
2018-09-03 21:38:27 -04:00
Nick Craver e16c69950c Dapper build fixes, versioning, and SQL CE drop
- Moves to NerdBank git-based versioning
- Cleans up build.ps1 to current (will tweak for older moves later)
- Updates xUnit to latest
- Moves to dotnet test, since they killed dotnet xunit
- Testing SQL Server CE has become unreasonable. It's gone (minimal cleanup in this commit disabling it).
2018-09-03 20:35:06 -04:00
Hristo Stefanov cd751c21f6 Fixed issue with empty sqldatarecord list as a table valued parameter. (#900)
System.ArgumentException is thrown when passing empty SqlDataRecord list as an anonymous object or as table-valued parameter to Dapper. Added two unit tests.
2018-07-01 16:08:54 -04:00
Nick Craver dfbcaa1601 Test and fix for #591
This brings behavior QueryAsync behavior on par with Query (sync) and properly returns nothing when an empty result set is encountered.
2018-03-06 22:54:06 -08:00
Dominik Herold 80231b4d2b fix equal tests (#944)
* fix equal tests

* fix test
2018-02-13 21:22:50 -05:00
ydango dc374ad105 Shortened the changes
Combined 2 tests into one
2017-11-05 20:07:13 -05:00
ydango 5b52424ca9 Tests for DateTime2 compatibility
This shows the importance of using DbType.DateTime2 in Dynamic Parameters to avoid precision truncation
2017-11-05 20:07:13 -05:00
Nick Craver 071a3fd5a0 .editorconfig and formatting 2017-08-21 16:25:48 -04:00
Nick Craver 7b34be3a25 net40 is dead - remove #if ASYNC bits 2017-08-21 15:25:57 -04:00
Nick Craver 4e99985dcc Fix unit tests 2017-08-21 08:25:02 -04:00
Nick Craver 8bc2f8c1c4 Merge pull request #782 from jiabiao/master
AddDynamicParameters repeated should work  while paramtype is DbString
2017-08-21 08:17:47 -04:00
Nick Craver bdebedea41 Tests: xUnit cleanup
This change:
- Removes the Assert shim
- Uses recommended xUnit methods (improving fail errors)
- Cleans up exception tests
- General test formatting fixes
- Removes the netcoerapp1.0 only testing (oops commit)
2017-08-20 23:00:08 -04:00
Nick Craver 1bd1b4f8f5 Fix for #808
Add dynamic overloads for:
- QueryFirstAsync
- QueryFirstOrDefaultAsync
- QuerySingleAsync
- QuerySingleOrDefaultAsync

This may change a lot in 2.x, but many people asking for them now so here they are. Unit tests also fixed for QuerySingleOrDefaultAsync.

Note: this builds on the netstandard2 branch because of the xUnit changes to go with VS 2017 15.3.
2017-08-20 16:50:56 -04:00
Nick Craver 76c2e186e2 More test fixes 2017-08-20 15:17:33 -04:00
Nick Craver 4637c10097 Upgade libs, fix tests
This uses the new non-parallel-at-the-end I added to xUnit in https://github.com/xunit/xunit/pull/1411 This way we can run any global test that are other-test-unfriendly much more easily.
2017-08-20 14:06:27 -04:00
Nick Craver ac7b9f5a6f Merge branch 'netstandard2' of https://github.com/StackExchange/Dapper into netstandard2 2017-08-15 12:58:07 -04:00
Sergii Volchkov a9560b3193 Enable SqlDataRecord TVPs on netstandard1.3. (#802)
* Enable SqlDataRecord TVPs on netstandard1.3.
* Update netstandard2.0 SqlClient references to Preview 2.
* Skip TransactionScope tests for netcoreapp2.0.
- According to https://github.com/dotnet/corefx/issues/12534, ambient transaction enlistment is not included with .net core 2.0.
* Update references in Dapper.StrongName.
* Disable parallel test run to stabilize flaky type handler tests.
* Disable parallel test run by assembly attribute.
* Move Issue461 tests to TypeHandlerTests.
* Group type handler tests in a collection, re-enable parallelization.
- Being part of the same collection, type handler tests will run sequentially. All other tests can run in parallel.
* Move tests relying on query cache & type maps to a separate collection.
2017-08-15 12:56:33 -04:00
Bill.B.Jia 02644d7791 fix issue #731: AddDynamicParameters repeated if paramtype is DbStiring should work. 2017-05-20 02:48:39 -07:00
Nick Craver ba641f1890 Merge MySQL fixes in 2017-05-13 07:35:54 -04:00
Bradley Grainger a46354a2e2 Fix MySQL tests and disposal (#774)
* Don't create the connection in Dispose: this avoids creating a SQLConnection simply to Dispose it.
* Run MySQL tests against the open MySqlConnection: 'connection' is a protected variable in the TestBase class that is a SQL Server connection, not a MySQL connection.
* Skip broken MySQL tests: as per issue #295, setting "AllowZeroDateTime=True" in the connection string causes an InvalidCastException in SqlMapper.
2017-05-12 18:18:34 -04:00
Nick Craver 7e5bd308f9 netstandard2.0 functionality (w/ runtime breaks)
This adds a netstandard2.0 build to Dapper (and StrongName until v2),
adds a netstandard2.0 test lineup, restores most functionality (except
UDTs for SQL, e.g. .UdtTypeName isn't in netstandard2), and also breaks
things not actually implemented or implemented correctly in
netstandard2.0. Pushing this up so we can work through these with the
.NET teams.

Several things are still broken here (and fail tests):
- Parameter decimal values (not filed yet)
- DataTables as parameters
(https://github.com/dotnet/corefx/issues/19708)
- .GetSchemaTable() (not yet filed, implementation is completely missing
from SqlDataReader in CoreFX)

While the compile is clean, the above are runtime issues.
`SqlParameter.UdtTypeName` is a separate issue, that one just wasn't in
`netstandard2.0` at all...so we can't support UDTs there until it is.
See https://github.com/dotnet/corefx/issues/17126 for details.
2017-05-12 10:03:00 -04:00
Nick Craver d72ae17a22 Dependency: Dapper doesn't need SqlClient, only Data.Common 2017-05-11 09:36:41 -04:00
Nick Craver 4d75b98206 Tests: make analyzers happy because why not 2017-05-08 14:47:36 -04:00
Nick Craver f613234413 Lots of code cleanup, no functional changes 2017-05-07 15:49:01 -04:00
Nick Craver f8d7a7a320 Skip the MySQL FUBAR test
It's indeed broken on their end. We should consider switching providers,
e.g. https://github.com/mysql-net/MySqlConnector/
2017-05-06 20:18:15 -04:00
Nick Craver 60b7807260 Fix SQL spatial type loading 2017-05-06 19:34:28 -04:00
Nick Craver 15c9e35a17 Fix type loads for the builds without SQL in the GAC 2017-05-06 19:17:56 -04:00
Nick Craver a83e0a7777 Fix Microsoft.SqlServer.Types for new .csproj 2017-05-06 19:07:50 -04:00
Nick Craver ab9807383a Appveyor: SQL 2016 2017-05-06 16:44:28 -04:00
Nick Craver 75d342fa64 VS 2017 Build - Making things work (#766)
* Progress on VS 2017 build tooling
* Finally, a working VS 2017 tooling build
2017-05-06 15:42:46 -04:00
Marc Gravell df4c301f3a Add tests for the too few/too many columns scenarios for value-tuples; happy to discuss alternative expectations 2017-04-07 14:43:40 +01:00
Marc Gravell f5938d7b4a remove redundant test code (oops) 2017-04-07 13:41:44 +01:00
Marc Gravell 9cc975b381 Define expected behaviour for value-tuple parameters and returns, and implement 2017-04-07 13:38:41 +01:00
Nick Craver ae7a29a9f1 VS 2017 .csproj Migration
Due to the way VS test works (by injecting an executable entry point), the performance tests needed to be factored out. I also organized all of our existing tests better along the way.
Actual code changes to Dapper itself are very minor, only formatting and documentation fixes (which we need many more of).

The build.ps1 script is upated to work, but note that <frameworkAssemblies> is not working in .nuspec inside the packages in the new .csproj system. I consider this to be a blocker. Issue is here: https://github.com/NuGet/Home/issues/4853
2017-03-25 19:34:10 -04:00
Jovan Popovic (MSFT) 71c16e6684 Fixed test issue in Simple.Data performance test (#723)
* Added fix for Simple.Data tast

Due to the missing .FirstOrDefault() in Simple.Data test, performance
numbers for Simple.Data were too high (better than hand coded data
reader). Added FirstOrDefault() to actually fetch the data.
2017-03-14 06:55:23 -04:00
Jovan Popovic 1369e5d0a7 Added Belgrade Sql Client
In the performance benchmark is added Belgrade Sql client data access
library (https://github.com/JocaPC/CLR-Belgrade-SqlClient). This is a
wrapper around ADO.NET classes that executes queries in async manner
using callbacks. "Belgrade.Sql.Client": "0.6.2" is aded in project.json
file, and new flag "BELGRADE" controls should the test be executed.
2017-02-22 14:20:55 +01:00
Nick Craver f0bbbab8e5 Rename package to "Dapper"
Related: #683
2017-02-08 21:27:14 -05:00
Nick Craver fe5c270ace Merge pull request #638 from hakon1912/master
Add SqlMapper.RemoveTypeMap() method
2017-01-26 19:18:01 -08:00
Marc Gravell 23e6b64c9f Revert "1.50.3-beta1: looks at #637 re Guid"
This reverts commit 91725fb309.
2017-01-06 13:53:50 +00:00