SQLite.Framework
1.4.0
See the version list below for details.
dotnet add package SQLite.Framework --version 1.4.0
NuGet\Install-Package SQLite.Framework -Version 1.4.0
<PackageReference Include="SQLite.Framework" Version="1.4.0" />
<PackageVersion Include="SQLite.Framework" Version="1.4.0" />
<PackageReference Include="SQLite.Framework" />
paket add SQLite.Framework --version 1.4.0
#r "nuget: SQLite.Framework, 1.4.0"
#addin nuget:?package=SQLite.Framework&version=1.4.0
#tool nuget:?package=SQLite.Framework&version=1.4.0
SQLite.Framework
A lightweight, experimental ORM for SQLite, designed for .NET MAUI with AOT support and LINQ-style IQueryable
querying.
Features
- AOT-ready: Designed for Ahead-Of-Time compilation in .NET MAUI apps.
- IQueryable interface: Write LINQ queries against your SQLite database.
- Inspired by EF & sqlite-net-pcl: Familiar patterns with minimal overhead.
⚠️ Experimental
This package is new and not recommended for production use. It may change at any point.
Installation
Install via NuGet:
dotnet add package SQLite.Framework
Quick Start
Define your model:
public class Person { [Key, AutoIncrement] public int Id { get; set; } public required string Name { get; set; } public DateTime? BirthDate { get; set; } }
Initialize the context:
using SQLite.Framework; var context = new SQLiteDatabase("app.db"); context.Table<Person>().CreateTable();
On the table class, you can use the [Table] attribute to specify the table name.
On the class properties:
- The [Column] attribute specifies the column name.
- The [NotMapped] attribute ignores the property.
- The [Key] attribute specifies the primary key.
- The [AutoIncrement] attribute is used to specify that the column should be auto-incremented.
- The [Required] attribute is used to specify that the column is NOT NULL (columns are NOT NULL by default, but using the ? operator marks them as nullable).
Query with LINQ:
// Insert context.Add(new Person { Name = "Alice" }); // Query var results = context.Table<Person>() .Where(p => p.Name.StartsWith("A")) .OrderBy(p => p.Id) .Select(p => new { p.Id + 1, p.Name }) .ToList();
Async query with LINQ:
// Insert await context.AddAsync(new Person { Name = "Alice" }); // Query var results = await context.Table<Person>() .Select(p => p.Id) .ToListAsync();
AOT Support
In order to use this library in AOT scenarios, you need to make sure the objects you are querying are either:
- Part of the assembly that is being AOT compiled (in other words it needs to be part of the code you see).
- Or simply make sure the classes are referenced in your code.
Limitations
- No indexes or foreign keys when using the built in-methods.
Contributing
This project is in early development. Feel free to:
- Report bugs or missing features.
- Submit PRs to add functionality or tests.
License
MIT © Nikolay Kostadinov
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 is compatible. 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. |
-
net8.0
- SQLitePCLRaw.bundle_green (>= 2.1.11)
-
net9.0
- SQLitePCLRaw.bundle_green (>= 2.1.11)
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.1.1 | 87 | 6/27/2025 |
2.1.0 | 127 | 6/23/2025 |
2.0.0 | 138 | 6/4/2025 |
1.4.1 | 128 | 6/1/2025 |
1.4.0 | 133 | 6/1/2025 |
1.3.1 | 145 | 5/19/2025 |
1.3.0 | 224 | 5/13/2025 |
1.2.1 | 232 | 5/12/2025 |
1.2.0 | 134 | 5/11/2025 |
1.1.2 | 119 | 5/9/2025 |
1.1.1 | 137 | 5/8/2025 |
1.1.0 | 136 | 5/8/2025 |
1.0.11 | 142 | 5/7/2025 |
1.0.10 | 147 | 5/7/2025 |
1.0.9 | 141 | 5/7/2025 |
1.0.8 | 135 | 5/7/2025 |
1.0.7 | 137 | 5/6/2025 |
1.0.6 | 134 | 5/6/2025 |
1.0.5 | 133 | 5/6/2025 |
1.0.2 | 134 | 5/5/2025 |
1.0.1 | 137 | 5/5/2025 |
1.0.0 | 140 | 5/5/2025 |