Skip to Content
TORMOverview and packages

TORM

On this page

TORM is a lightweight ORM for bulk writes and queries. Native database transport, cached entity metadata and column projection reduce repeated work, alongside mapping, CodeFirst, transactions, sharding and native upsert. OrmClient lives in TORM; database implementations ship as separate provider packages.

Install and run your first query

Install the core package and SQLite provider; no separate database service is required:

dotnet add package TORM dotnet add package TORM.Sqlite

SQLite CRUD example · API reference · Bulk API selection

Performance at a glance

Fixed workloadTORM resultCompared with EF Core + BulkExtensions
SQLite: insert 10,000 rows26.67 ms80.6% less managed allocation
SQL Server: selected-column update, 10,000 rows71.17 ms60.4% less time, 91.5% less allocation
MySQL: update all columns, 10,000 rows146.27 ms67.5% less time

Medians from the 2026-11-22 fixed-workload short runs on .NET 10.0.15. Allocation is not peak memory. See performance and benchmarks for all four databases, comparison versions, workloads where TORM took longer, and API guidance.

Package selection

PackageAccess model
TORMRelational core, mapping attributes and query/write APIs
TORM.SqliteSQLite
TORM.MySqlMySQL / MariaDB
TORM.SqlServerSQL Server
TORM.PostgreSqlPostgreSQL
TORM.QuestDbQuestDB REST SQL, schema and CSV import
TORM.TaosDataTDengine Native / WebSocket
TORM.IoTDBApache IoTDB Native API, explicit tree/table models
TORM.GeneratorsCompile-time module initialization and registration

DatabaseType contains MySql, SqlServer, Sqlite, PostgreSql and None. Time-series packages expose separate clients.

Reading path

TaskGuide
Map entities and initialize schemaMapping
Filter, project, page and stream recordsQueries
Evaluate write time and query allocationPerformance and benchmarks
Insert, update, delete, upsert and bulk writeWrites
Aggregate and downsample valuesAggregation and time buckets
Commit, cancel and roll back transactionsTransactions
Route databases and shard tablesMultiple databases and sharding
Access QuestDB, TDengine or IoTDBTime-series clients
Trim and publish Native AOTAOT

Dependencies and costs

Depends on TUtility.Core. Each OrmClient retains a connection and mutable state; use independent clients for concurrent work. Lists materialize all results. Use async enumeration or cursor paging for large results.