Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.47 KB

sqlite.md

File metadata and controls

40 lines (25 loc) · 1.47 KB
title SQLite Example
description Use an in-memory SQLite database for a compact integration example.
Home/Examples/SQLite Example

Required packages: Dapper.FluentMap, Microsoft.Data.Sqlite

Problem solved

Use an in-memory SQLite database for a compact integration example.

When to use it

Use this capability when the column shape and .NET model should remain separated by explicit, reviewable configuration.

Example

using var connection = new SqliteConnection("Data Source=:memory:");
connection.Open();
var customer = connection.QuerySingle<Customer>(sql);

How it works

FluentMap registers typed metadata and applies it through the matching materialization path. SQL, connections, parameters, and lifecycle remain responsibilities of the application and Dapper.

Constraints

:::caution Initialize before concurrent queries and treat the effective configuration as read-only afterward. :::

Related references