-
Notifications
You must be signed in to change notification settings - Fork 2
Home
github-actions[bot] edited this page Sep 2, 2026
·
22 revisions
A lightweight ORM for SQLite, built for .NET, Avalonia and other AOT-published .NET apps. It gives you LINQ queries, async support and AOT compatibility, with an API that will feel familiar if you have used Entity Framework before.
SQLiteOptions options = new SQLiteOptionsBuilder("library.db")
.UseMinimumSqliteVersion(SQLiteMinimumVersion.V3_36)
.Build();
using SQLiteDatabase db = new(options);
await db.Schema.CreateTableAsync<Book>();
var books = db.Table<Book>();
await books.AddAsync(new Book { Title = "Clean Code", Price = 29.99m });
var affordable = await books.Where(b => b.Price < 30).ToListAsync();| Package | What it offers |
|---|---|
SQLite.Framework |
Default. Uses the OS-provided SQLite on desktop and iOS and bundles its own on Android, which has no app-usable system SQLite. |
SQLite.Framework.Bundled |
Ships its own SQLite binary, independent of the OS-provided SQLite. |
SQLite.Framework.Cipher |
Uses SQLCipher for encrypted databases. Call UseEncryptionKey on the options builder to enable encryption. |
SQLite.Framework.Base |
No SQLite provider included. You supply your own SQLitePCLRaw provider and call SQLitePCL.Batteries_V2.Init() before creating a database. |
SQLite.Framework.DependencyInjection |
AddSQLiteDatabase helpers that register a SQLiteDatabase (or a subclass) into an IServiceCollection for Microsoft.Extensions.DependencyInjection. |
SQLite.Framework.SourceGenerator |
Build-time source generator that writes materializers for entities, Select projections and projected JSON collections. Recommended for Native AOT builds, where it removes the reflection-driven materializer path. |
All SQLite-provider packages (Framework, Bundled, Cipher, Base) expose the same API and assembly name, so you can swap between them without changing any code. The other packages layer optional features on top.
- LINQ queries with
IQueryablesupport - Async versions of every operation
- CRUD operations with typed tables
- Joins, group by, aggregates and subqueries
- Set operations with continued filtering, projection, grouping, ordering and aggregates
- Bulk delete and update with
ExecuteDeleteandExecuteUpdate - Transactions using SQLite savepoints
- Raw SQL via
FromSql - Full-text search through SQLite's FTS5 module
- Spatial queries through SQLite's R-Tree module
- AOT compatible, works great in .NET MAUI and Avalonia apps
- Supports .NET 8, 9 and 10
- Overview
- Getting Started
- Choosing a SQLite Version
- Defining Models
- Samples
- CRUD Operations
- Querying
- Query Filters
- Expressions
- Subqueries
- Joins
- Grouping and Aggregates
- Bulk Operations
- Transactions
- Multi-threading
- Raw SQL
- Common Table Expressions
- Pragmas
- Backup
- Attached Databases
- Schema
- Migrations
- Triggers
- Views
- Limitations
- Data Types
- Storage Options
- Custom Converters
- Dates and Times
- JSON and JSONB
- Window Functions
- Full Text Search
- R-Tree
- SQLite Functions
- Performance
- Logging
- Native AOT
- Source Generator
- Dependency Injection
- Platform Support
- Testing
- Troubleshooting
- Data Seeding
- Existing Databases
- Recipes
- Migrating from sqlite-net-pcl
- Migrating from EF Core
- AI Assistance