TinyORM 2.0.2
dotnet add package TinyORM --version 2.0.2
NuGet\Install-Package TinyORM -Version 2.0.2
<PackageReference Include="TinyORM" Version="2.0.2" />
paket add TinyORM --version 2.0.2
#r "nuget: TinyORM, 2.0.2"
// Install TinyORM as a Cake Addin #addin nuget:?package=TinyORM&version=2.0.2 // Install TinyORM as a Cake Tool #tool nuget:?package=TinyORM&version=2.0.2
Simple, fast, and secure micro ORM for .NET ![NuGet](https://img.shields.io/nuget/v/TinyORM.svg)
TinyORM by Stan Drapkin [sdrapkin at sdprime dot com]
Documentation: wiki
Features:
- Focused on SQL Server (any
SqlClient
-based db engine). Azure SQL is supported as well. - Intuitive, tiny, simple API. This is usually the hardest part for libraries to get right.
- Does not obscure or reinvent
T-SQL
. If you prefer APIs that hideT-SQL
incompetence, look elsewhere. - Very fast. As fast as competition (
Dapper
,OrmLite
,LLBLGen
,EF Core
, etc. benchmarks). - Seamlessly transactional and safe. Transactions are not merely supported - they are the default.
XACT_ABORT=ON
(automatic transaction rollback on runtime T-SQL errors).- Custom transaction scopes are declared via standard
TransactionScope
instance (created viaTinyORM
.DbContext
.CreateTransactionScope()
factory).
- Transparent connection management. One less thing to worry about and screw up. Never think about connections again.
Task
-basedasync
API (ie. the API). All calls are buffered (focus on safety and fast connection release).- POCOs or
anonymous
objects are fine. No inheritance, interface, or attribute requirements. - Returns
dynamic
entities which can be consumed directly, or projected to statically-typed objects (fast!).- Either strict (perfect-match) or relaxed (best-effort) projection of
dynamic
to statically-typed objects.
- Either strict (perfect-match) or relaxed (best-effort) projection of
- Full parameterization, with parameter list expansion (ex.
WHERE Id IN (@IdList)
). This also helps prevent SQL injection.CHAR
,VARCHAR
,NCHAR
,NVARCHAR
support forstring
parameters.
- Single or multiple Result Sets.
- Snapshots provide change-tracking, with
UPDATE
T-SQL
generation for partial updates. - Intelligent batched *bulk* command sequences via
QueryBatch
(not just forINSERT
- for allCREATE/UPDATE/DELETE/MERGE
commands). - Streaming data-out support (ex. streaming out
BLOBs
/files). - Auditing
- Caller identity tracking (which user made the call?).
- Callsite tracking (which source code filename, method, and line# made the call?).
- Helpers for
CREATE
,UPDATE
,DELETE
, andUPSERT
T-SQL
generation. SequentialGuid
generator for fragmentation-free, unique, unguessable, code-generated clustereduniqueidentifier
indexes.- c# 10.0 in
safe
mode. Compiledany cpu
for .NET 4.5.2+ and NetStandard 2.0/.NET Core 2.0+. - Tiny codebase. Tiny ~45k
.dll
. TinyORM
on NuGet (Install-Package TinyORM
).- MS-PL (Microsoft Public) license. If MS-PL does not suit you, contact me.
If you are serious about SQL Server, give TinyORM a try (even if you're a Dapper
fan).
Simple TinyORM query
var db = DbContext.Create(connString);
var query = await db.QueryAsync("select [Answer] = @a + @b", new { @a = 123, @b = 2 });
Console.WriteLine(query.First().Answer); // prints "125"
static string connString = "Data Source=.\\SQL2012; Initial Catalog=tempdb; Integrated Security=True;";
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Microsoft.Data.SqlClient (>= 6.0.1)
- System.Reflection.Emit (>= 4.7.0)
- System.Reflection.Emit.Lightweight (>= 4.7.0)
- System.ValueTuple (>= 4.5.0)
-
net8.0
- Microsoft.Data.SqlClient (>= 6.0.1)
- System.Reflection.Emit (>= 4.7.0)
- System.Reflection.Emit.Lightweight (>= 4.7.0)
- System.ValueTuple (>= 4.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.2 | 42 | 2/12/2025 |
2.0.0 | 119 | 12/11/2024 |
1.3.7 | 211 | 1/16/2024 |
1.3.6 | 924 | 11/9/2022 |
1.3.5 | 628 | 2/1/2022 |
1.3.4 | 489 | 1/29/2022 |
1.3.3 | 5,737 | 9/29/2020 |
1.3.2 | 729 | 2/20/2020 |
1.3.1 | 906 | 1/3/2020 |
1.3.0 | 2,103 | 10/24/2019 |
1.2.7067.20307 | 3,130 | 5/8/2019 |
1.1.6898.20236 | 1,470 | 11/20/2018 |
1.1.6862.24420 | 835 | 10/15/2018 |
1.1.6848.28993 | 855 | 10/1/2018 |
1.1.6701.26060 | 1,706 | 5/7/2018 |
1.1.6528.30785 | 1,030 | 11/15/2017 |
1.1.6326.31656 | 1,696 | 4/27/2017 |
1.0.6314.33866 | 1,008 | 4/15/2017 |
1.0.6310.25316 | 1,018 | 4/11/2017 |
1.0.6309.30883 | 1,029 | 4/10/2017 |
1.0.5 | 1,066 | 3/23/2017 |
1.0.4 | 1,006 | 3/21/2017 |
1.0.3 | 1,046 | 1/25/2017 |
1.0.2 | 1,037 | 1/4/2017 |
Switched to Microsoft.Data.SqlClient [https://techcommunity.microsoft.com/blog/sqlserver/announcement-system-data-sqlclient-package-is-now-deprecated/4227205].
Retargeted for [net8.0+] (modern use) and [net48] (legacy use).
Tested with Microsoft.Data.SqlClient 6.0.1 (https://learn.microsoft.com/en-us/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace).
DbContext.Create() gets a new SqlConnectionOverrides parameter (https://learn.microsoft.com/en-us/dotnet/api/microsoft.data.sqlclient.sqlconnectionoverrides).
Added support for System.DateOnly and System.TimeOnly (.NET 8+).