Commit Graph
15 Commits
Author SHA1 Message Date
Marc GravellandNick Craver 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
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
Nick Craver 071a3fd5a0 .editorconfig and formatting 2017-08-21 16:25:48 -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
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
Nick Craver ad0a262285 Contrib, Rainbow, EntityFramework & SqlBuilder: code cleanup 2015-11-24 20:20:52 -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
Chris Hynes 2067b00bcb Actually pass IsInclusive param to Clause so OrWhere can work 2014-09-17 08:32:20 -07:00
AndrewMSpencer 0451379032 Inclusive/Exclusive Where Clauses and Intersect
Added two new features:  OrWhere extension for combining where clauses in an inclusive vs exclusive context (Or vs And) and Intersect extension.
2014-06-05 10:33:03 -04:00
Xavier Poinas a561cb987e Added support for INNER JOIN and RIGHT JOIN in SqlBuilder 2012-02-14 21:55:52 +01:00
Sam Saffron c9160c13fb Upped dapper to 1.8
Broke SqlBuilder to another assembly
Added Dapper.Rainbow (minimal ORM)
Changed nuget to distribute DLLs
2012-01-12 15:22:01 +11:00