SQLite.Framework.Window
4.5.0
As of version 5.0.0, the Window package is now built into the SQLite.Framework package
See the version list below for details.
dotnet add package SQLite.Framework.Window --version 4.5.0
NuGet\Install-Package SQLite.Framework.Window -Version 4.5.0
<PackageReference Include="SQLite.Framework.Window" Version="4.5.0" />
<PackageVersion Include="SQLite.Framework.Window" Version="4.5.0" />
<PackageReference Include="SQLite.Framework.Window" />
paket add SQLite.Framework.Window --version 4.5.0
#r "nuget: SQLite.Framework.Window, 4.5.0"
#:package SQLite.Framework.Window@4.5.0
#addin nuget:?package=SQLite.Framework.Window&version=4.5.0
#tool nuget:?package=SQLite.Framework.Window&version=4.5.0
SQLite.Framework
A lightweight 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.
Documentation
- GitHub Wiki - browse the docs on GitHub
- GitHub Pages - the same docs as a standalone site
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 following:
- The [Table] attribute to specify the table name.
- The [WithoutRowId] attribute to use the without rowid optimization.
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 [Index] attribute creates an index on the column or make a column unique.
- 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 (the user's code).
- Or simply make sure the classes are referenced in your code.
Contributing
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 is compatible. 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.