Commit Graph

66 Commits

Author SHA1 Message Date
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
Marc Gravell 67f7a1fe17 add Microsoft.CodeAnalysis.PublicApiAnalyzers on the main libs (#1948) 2023-08-18 11:47:37 +01:00
Wei 31981fdf51 Add Documentation for Dapper.SqlBuilder (Issue #688, #480) (#1679)
Add Documentation for Dapper.SqlBuilder (Issue #688, #480)
2021-07-04 08:12:52 -04: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
Wei 5c87dc9738 SqlBuilder Support Update Set (#1404)
I add update `Set` method and unit test.

e.g: 
```C#
var sb = new SqlBuilder()
       .Set("vip = @vip", new { vip })
       .Set("updatetime = @updatetime", new { updatetime })
       .Where("id = @id", new { id })
;
var template = sb.AddTemplate("update #Users /**set**/ /**where**/");
connection.Execute(template.RawSql, template.Parameters);
```

RawSql will generate : 
```
update #Users Set vip = @vip , updatetime = @updatetime\n WHERE id = @id\n
```

using Dapper Execute in sqlserver it'll reqeust by below sql command
```
exec sp_executesql N'update #Users Set vip = @vip , updatetime = @updatetime
 WHERE id = @id
',N'@vip bit,@updatetime datetime,@id int',@vip=1,@updatetime='2020-01-01 00:00:00',@id=1
```

Co-authored-by: Nick Craver <nrcraver@gmail.com>
Co-authored-by: Nick Craver <craver@stackoverflow.com>
2020-05-01 19:25:12 -04:00
Marc Gravell 765300a32b Enable deterministic build (#1433)
* - enable deterministic build
- lib updates for core packages

* set source root if needed

* Restore VS test runner

xUnit won't run in VS without it :)

Co-authored-by: Nick Craver <craver@stackoverflow.com>
2020-04-05 13:43:31 +01:00
mgravell 7769253d59 framework and tooling lib updates; does *NOT* include the full corpus of 3rd party ADO.NET providers 2019-09-27 10:39:40 +01:00
Nick Craver 1481c4d379 Tooling and project updates (#1333)
This is a branch cleaning up old `#if` clauses, `.csproj` bits, Linux build compatibility, and a few other tid-bits (broken out by commit).

In general: we're on 3.0 tooling and all previous cruft has been removed.
2019-09-26 19:47:55 -04:00
mgravell aefb2840bb reinstate net461 TFM; fix #1325 2019-09-12 08:30:35 +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
Nick Craver 071a3fd5a0 .editorconfig and formatting 2017-08-21 16:25:48 -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 f613234413 Lots of code cleanup, no functional changes 2017-05-07 15:49:01 -04: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
Nick Craver f0bbbab8e5 Rename package to "Dapper"
Related: #683
2017-02-08 21:27:14 -05:00
jods ba8f3fadc8 Non-greedy match for comments regex
Fixes #436, #280
My editor has also normalized a few line endings to LF like 99% of the
file was.
2016-10-05 19:24:40 +02:00
lsymds efe8d2eb08 Fix SqlBuilder.OrWhere method which was actually yielding an 'AND WHERE' statement. 2016-07-30 23:34:05 +01:00
Marc Gravell e15cb95d92 1.50.2 2016-07-22 14:53:06 +01:00
Marc Gravell 2b9a3d489a Failing test for #552 2016-07-20 13:28:21 +01:00
Nick Craver be5f196546 .Net Core 1.0 RTM update 2016-06-28 17:48:50 -04:00
Nick Craver 2c531d2c06 This .0 addition happens automatically...make it explicit instead. 2016-05-24 08:57:33 -04:00
Nick Craver 3d4d251a78 Switch version suffix to be a build parameter
Note: build.sh needs love from OS X/*nix later to match
2016-05-24 08:38:24 -04:00
Nick Craver 41f1fe3e3c .xproj: RC2 upgrade
This fixes null refs with the DNX MSBuild targets when building from
Visual Studio.
2016-05-24 07:29:18 -04:00
Nick Craver ad5378fcb0 RC2 Version bump, since we locked ourselves in with semver on beta9 2016-05-19 11:34:16 -04:00
Nick Craver 84a7d6464a RC2 master merge 2016-05-19 08:53:36 -04:00
Nick Craver ee615c0cc3 Upgrade project.json files to RC2 format.
Note: on a nuspec comparison, the following dependencies aren't there
anymore: Microsoft.CSharp, mscorlib, System, and System.Core aren't
explicitly specified in frameworkAssemblies anymore. The only one of
these I can imagine mattering is Microsoft.CSharp.
2016-05-17 09:48:01 -04:00
Nick Craver 10581e867e Update to RC2 final build (24027) libraries. Also bump to beta10 2016-05-16 20:54:26 -04:00
Nick Craver 7edadbd4c9 .Net Core: remove floating versions (use stable ones on Nuget.org) and get this puppy back in action.
Also: it's 2016.
2016-04-17 16:42:13 -04:00
Oren Novotny cf732e0d98 Get building 2016-04-16 21:57:07 -04:00
Oren Novotny dfff5f3724 fix outpt paths 2016-04-16 20:22:59 -04:00
Marc Gravell 2b4bb22dbd 1.50-beta9 2016-04-01 09:47:54 +01:00
Marc Gravell 4da982e2c7 Heh, AspNet and DNX (only) work in VS2015; DNX and DotNet (only) work in VS15; I guess we need to use DNX for now, then, as the only one that works in both. 2016-04-01 09:22:12 +01:00
Marc Gravell fc50aa7833 Recreate all the xproj to reflect the current tooling - old versions break VS15; enable XDocument etc in corefx (#if block was too large) 2016-04-01 09:00:33 +01:00
Marc Gravell 2a2c086009 1.50-beta8 deploy 2016-02-17 10:34:29 +00:00
Nick Craver ad0a262285 Contrib, Rainbow, EntityFramework & SqlBuilder: code cleanup 2015-11-24 20:20:52 -05:00
Nick Craver 7915f58f26 Move to Microsoft.SqlServer.Compact for Contrib tests 2015-11-22 18:03:01 -05:00
Nick Craver fd10fe7ccb A full CoreCLR/DNX friendly conversion
This eliminates the dual solutions and brings Contrib into the
project.json fold.
- Tests are ported to xUnit though SQLite is disabled on DNX due to
Issue #375 (Interop loads fail in the VS runner and  params are busted
regardless).
- Projects are consolidated down to what's currently possible with
project.json.
- Contrib moved to: Dapper.Contrib and Dapper.Tests.Contrib (so tests
appear at the end, no other reason vs. Dapper.Contrib.Tests)
- EF moved to: Dapper.EntityFramework(.StrongName)
- Rainbow moved to: Dapper.Rainbow
- SqlBuilder moved to: Dapper.SqlBuilder
- Packages are removed since it's not current-tooling friendly to keep
them (nor was it using them).
- xUnit implemented in Contrib via abstracts - this allow us to very
quickly add any database provider to the rig in a very concise way.
- Contrib unit tests fixed in various places - they were not
parallel-runner friendly
- Nuspecs removed, since they aren't used anymore (to eliminate
confusion)
- Removed speed tests for libraries that aren't on current versions of
.Net (what would we be comparing?)
- Perf tests moved to Dapper.Tests (consolidation from
Dapper.DNX.Tests), but aren't activated yet (no define)
2015-11-22 17:56:33 -05:00
Jeremy Borg 8839cfd55f Change access modifier of AddClause method to "protected". 2015-11-15 10:11:46 +01:00
Henk Mollema ea10a1890e Add .NET 3.5 project for SqlBuilder.
- New project which targets .NET 3.5.
- CSHARP30 debug symbol.
- if statements for dynamic parameters.
- Used .ToArray with string.Join().
- Remove optional parameters on .NET 3.5
- Remove named arguments
2015-10-12 16:03:49 +02:00
Marc Gravell e64003a5a1 1.40 deploy 2015-04-03 09:32:36 +01:00
Marc Gravell 51192328e0 Package updates 2015-03-18 13:23:12 +00:00
Marc Gravell 8df328f849 1.38 release 2014-10-30 15:07:38 +00:00
Marc Gravell 8e33a56df1 1.37 release 2014-10-22 10:27:11 -06:00
Marc Gravell d9f2801f0d 1.36 release 2014-10-14 15:49:53 +01:00
Marc Gravell e2ccfbf279 Merge pull request #173 from programcsharp/fixsql
Actually pass IsInclusive param to Clause so OrWhere can work
2014-10-09 08:13:47 +01:00
Marc Gravell 1f341bb611 Release 1.35 2014-09-29 09:02:49 +01:00
Chris Hynes 2067b00bcb Actually pass IsInclusive param to Clause so OrWhere can work 2014-09-17 08:32:20 -07:00
Marc Gravell 5472d2abb0 1.34: Support for SqlHierarchyId (core) 2014-08-28 10:07:38 +01:00
Marc Gravell 62bdcd1bb2 1.33: SqlGeometry (core) and DbGeometry (EF) support 2014-08-28 09:53:16 +01:00
Marc Gravell 54bc52b306 1.32: Support for SqlGeography in core library 2014-08-28 09:04:09 +01:00