Funcular.Data.Orm 0.1.1-alpha.3

This is a prerelease version of Funcular.Data.Orm.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Funcular.Data.Orm --version 0.1.1-alpha.3
                    
NuGet\Install-Package Funcular.Data.Orm -Version 0.1.1-alpha.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Funcular.Data.Orm" Version="0.1.1-alpha.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Funcular.Data.Orm" Version="0.1.1-alpha.3" />
                    
Directory.Packages.props
<PackageReference Include="Funcular.Data.Orm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Funcular.Data.Orm --version 0.1.1-alpha.3
                    
#r "nuget: Funcular.Data.Orm, 0.1.1-alpha.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Funcular.Data.Orm@0.1.1-alpha.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Funcular.Data.Orm&version=0.1.1-alpha.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Funcular.Data.Orm&version=0.1.1-alpha.3&prerelease
                    
Install as a Cake Tool

FunkyORM: The Speedy, Lambda-Powered ORM for MSSQL

Welcome to FunkyORM, the micro-ORM that promises speed, simplicity, and lambda expression support—all in one lightweight package!

If you're tired of the overhead of Entity Framework or the limitations of Dapper when it comes to expressive queries, FunkyORM is your answer. Designed for developers who need to get up and running fast with minimal setup, FunkyORM bridges the gap with:

  • Instant Lambda Queries: No more wrestling with raw SQL in Dapper to achieve complex queries; use familiar C# lambda expressions to craft your SQL statements effortlessly.
  • Performance without Bulk: Outperforms many alternatives in benchmarks, offering the power you need without the bloat.
  • Zero to Query in Seconds: Minimal configuration means you can start querying your MSSQL databases with just your entity classes. Forget about contexts or extensive model setups!

Are you ready to see how easy and powerful database operations can be? Clone the repository, set up the test environment, and experience the efficiency of FunkyORM firsthand.

The General Idea

FunkyORM-Simplicity-Diagram-Reduced


Details

FunkyORM is designed to be a low-impedance, no-frills interface to MSSQL. It is a micro-ORM designed to fill a niche between heavy solutions like EntityFramework and other micro-ORMs like Dapper. FunkyORM features what we think is a more natural query syntax: Lambda expressions. It supports the most commonly used types and operators used in query criteria.

FunkyORM requires little configuration. Most of its behaviors can be achieved using bare entities with few or no annotations. No contexts and no entity models are needed. Annotations are supported where needs diverge from the most common use cases; just write or generate entities for your tables and start querying.

Key attributes:

  • Fast: Competitive benchmarks when compared to similar alternatives
  • Small footprint: completely agnostic to DbContexts, models, joins, and relationships
  • Easy to use: Support lambda queries out of the box
  • Usability over power:
    • Implements sensible defaults for common PK naming conventions (e.g., any of idtablename_idTableNameId are detected automatically)
    • Supports [key] attribute for cases where primary key column names diverge from these conventions
    • Auto maps matching column names ignoring case and underscores by default
    • Ignores properties/columns not present in both source table/view and target entity by default
  • Easily customized: Supports System.ComponentModel.DataAnnotations attributes like [Table][Column][Key][NotMapped] Our goal is to make it easy for developers to get up and running quickly doing what they do 80% of the time, while making it hard for them to shoot themselves in the foot; we avoid automating complex behaviors that should really be thought through more thoroughly, like joins, inclusions, recursions, etc.

Features

FunkyORM is designed to be a near-drop-in replacement for Entity Framework that is as dependency-free as possible.

What It Does:

  • GET command (by id / PK)
  • SELECT queries
    • Lambdas, with operators IS NULL , IS NOT NULL , = , <> , > , >= , < , <= , LIKE , AND , OR , IN
    • C# .StartsWith, EndsWith and Contains invocations on strings
    • C# .Contains invocations on arrays (converts these to IN clauses with a SqlParameter for each member of the IN set)
    • C# OrderBy, ThenBy, OrderByDescending, ThenByDescending, Skip, Take
    • C# Any (with an optional predicate), All (predicate is required)
    • C# Aggregates like Count, Average, Min, Max on single column expressions
  • UPDATE commands
    • By id / PK
    • By WHERE clause
  • INSERT commands
  • Observes several System.ComponentModel.DataAnnotations.Schema annotations
    • Table
    • Column
    • Key
    • NotMapped
    • DatabaseGenerated

What It Does Not Do

  • DELETE commands (see note below)
  • Bulk inserts
  • Joins / relationships / foreign-keys / descendants
  • Execute query criteria that don't translate to SQL (see the supported operators above)
  • Query on columns without corresponding entity properties
  • Query on derived expressions or calculated properties (e.g., you can't use expressions like order.UnitPrice * order.Quantity > 100)

Funky is made for developers who don't want a bunch of ceremony, and who prefer to do their own relational queries, i.e., get a collection of Customers, project their ids to an array, then get children: var customerOrders = Orders.Where(x => customerIds.Contains(x.CustomerId)), instead of letting EntityFramework set you up for an ‘N+1 selects’ problem or inefficient joins.

We made FunkyORM to use ourselves, and we enjoy using it. We hope you do too!

Note: As a user, you won’t be able to delete data through FunkyORM right now. This limitation is intentional to protect your data while we refine the tool. If you need to perform deletions, you’ll need to use an alternative approach outside the ORM, like direct database queries. We encourage you to share your feedback on how this impacts your workflow—it’ll help us prioritize adding DELETE support in future releases.

Quickstart

The easiest way to get started with FunkyORM is to execute the provided scripts to create and populate the integration test database ([funky_db]). Everything needed to do this is provided in the solution. The test project already contains entities and business objects to demonstrate the basic features of Funky.

Walkthrough - trying the unit tests is the fastest way to get started:

  • Clone the repository to your local machine.
  • Connect to a SQL Server you control.
  • Create the SQL database: Execute the included integration_test_db script to create the database.
  • Generate mock data: Execute the provided integration_test_data script to populate the database with mock data.
    • If you created the database as funky_db on the default SQL instance on localhost and can connect via SSPI/integrated security, you're good to go and you should be able to run the integration tests.
    • If the database is in any other location (different server, SQL instance, database name, etc.), you can edit the connection string in the unit tests, or create and set an environment variable, FUNKY_CONNECTION, to point to the server/database you created. The unit tests should recognize this, and it will help prevent you from accidentally checking in SQL credentials.
  • Set your connection string: You can edit this in the unit test initialization, or set an environment variable, FUNKY_CONNECTION, which your environment should pick up automatically (may require a restart of VS to refresh environment variables).
  • Ensure you have either TrustServerCertificate = true or Encrypt = false in the connection string; see "Important" note below for explanation
  • Run the unit tests ...and boom! There you go. 💥

IMPORTANT: FunkyORM uses Microsoft.Data.SqlServer, which superseded System.Data.SqlServer as of .NET Core 3.0. This introduced a breaking change with connection strings; if your server does not have a CI-trusted certificate installed, you must include either TrustServerCertificate = true or Encrypt = false in the connection string, or the connection will fail. See https://stackoverflow.com/questions/17615260/the-certificate-chain-was-issued-by-an-authority-that-is-not-trusted-when-conn for more info on this.

Next steps:

  • Review the contents of the integration tests
  • Write a simple lambda-based query just like you would with Entity Framework
Product 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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 10 9/4/2025
1.0.0 132 8/30/2025
0.9.2 174 8/27/2025
0.9.1-beta.2 162 8/26/2025
0.9.1-beta.1 161 8/26/2025
0.5.1-beta.1 134 8/25/2025
0.1.1-alpha.5 137 8/25/2025
0.1.1-alpha.4 112 8/20/2025
0.1.1-alpha.3 110 8/20/2025
0.1.1-alpha.2 112 8/20/2025