Agent skill

Maui Sqlite Database

by davidortinau in davidortinau/maui-skills

Add SQLite local database storage to .NET MAUI apps using sqlite-net-pcl.

MITAuto-check passedDatabases

Install Maui Sqlite Database

skills CLI
$ npx skills add davidortinau/maui-skills --skill maui-sqlite-database -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davidortinau/maui-skills maui-sqlite-database --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davidortinau/maui-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/maui-skills/skills/maui-sqlite-database .claude/skills/maui-sqlite-database && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
maui-sqlite-database
GitHub stars
174
Token cost
~1.2k tokens
SKILL.md length
265 words
Files
2 (incl. references)
Skills in repo
41
Repo updated
First seen
Licence
MIT

At a glance

Add SQLite local database storage to .NET MAUI apps using sqlite-net-pcl.

  • Works in 5 steps: Use transactions for batch writes —… → Add [Indexed] to frequently queried… → WAL mode eliminates reader/writer… → …
  • : SQLite database
  • SKILL.md covers ⚠️ Wrong Package Trap, Common Mistakes, Platform Pitfalls and Decision Framework, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Maui Sqlite Database is an agent skill from davidortinau/maui-skills. Add SQLite local database storage to .NET MAUI apps using sqlite-net-pcl. Covers data models with ORM attributes, async database service with lazy init, DI registration, WAL mode, and file management. Works with any UI pattern (XAML/MVVM, C Markup, MauiReactor). USE FOR: "SQLite database", "local database", "sqlite-net-pcl", "offline storage", "CRUD database", "database service", "WAL mode", "CreateTableAsync", "local data persistence", "ORM attributes". DO NOT USE FOR: REST API data fetching (use maui-rest-api)…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/sqlite-database-api.md`).

It sits in Databases, covering Cross-platform mobile apps, ORMs and data access and REST APIs. It works with SQLite and C#. The repository describes itself as: .NET MAUI skills for GitHub Copilot and Claude Code. The licence is MIT.

When your agent uses it

  • : SQLite database
  • Offline storage
  • Database service
  • CreateTableAsync

Example prompts

  • “SQLite database”
  • “local database”
  • “sqlite-net-pcl”
  • “/maui-sqlite-database”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Use transactions for batch writes — individual inserts are slow; wrap in RunInTransactionAsync
  2. Add [Indexed] to frequently queried columns — especially foreign keys
  3. WAL mode eliminates reader/writer contention
  4. Avoid ToListAsync() on large tables — use Where() filtering and pagination
  5. Use raw SQL for complex queries — QueryAsync is faster than chained LINQ for joins

What it can do on your machine

Read from SKILL.md and the folder at commit 79bb4bf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp and xml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Maui Sqlite Database loads about 1.2k tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 159 tokens; SKILL.md has 265 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~159
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davidortinau/maui-skills at commit 79bb4bf, republished under its MIT licence (© davidortinau). 265 words, ~1,211 tokens.

Download SKILL.mdSave it as .claude/skills/maui-sqlite-database/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
maui-sqlite-database
description
Add SQLite local database storage to .NET MAUI apps using sqlite-net-pcl. Covers data models with ORM attributes, async database service with lazy init, DI registration, WAL mode, and file management. Works with any UI pattern (XAML/MVVM, C# Markup, MauiReactor). USE FOR: "SQLite database", "local database", "sqlite-net-pcl", "offline storage", "CRUD database", "database service", "WAL mode", "CreateTableAsync", "local data persistence", "ORM attributes". DO NOT USE FOR: REST API data fetching (use maui-rest-api), secure credential storage (use maui-secure-storage), or file picking (use maui-file-handling).

SQLite Database — Gotchas & Best Practices

For full service implementation, constants, data model templates, and common patterns, see references/sqlite-database-api.md.

⚠️ Wrong Package Trap

xml
<!-- ❌ WRONG — these are different libraries with incompatible APIs -->
<PackageReference Include="Microsoft.Data.Sqlite" />
<PackageReference Include="sqlite-net" />
<PackageReference Include="SQLitePCL.raw" />

<!-- ✅ CORRECT — sqlite-net-pcl by praeclarum + its bundle -->
<PackageReference Include="sqlite-net-pcl" Version="1.9.*" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.*" />

Common Mistakes

❌ Using Environment.GetFolderPath for Database Path
csharp
// ❌ Not cross-platform safe — fails on some MAUI targets
var path = Path.Combine(Environment.GetFolderPath(
    Environment.SpecialFolder.LocalApplicationData), "app.db3");

// ✅ Use FileSystem.AppDataDirectory for all MAUI platforms
var path = Path.Combine(FileSystem.AppDataDirectory, "app.db3");
❌ Multiple SQLiteAsyncConnection Instances

SQLiteAsyncConnection is not thread-safe for multiple instances pointing at the same file. Use a single instance via DI singleton:

csharp
// ❌ Creating new connections per request
public async Task<List<Item>> GetItems()
{
    var db = new SQLiteAsyncConnection(Constants.DatabasePath);
    return await db.Table<Item>().ToListAsync();
}

// ✅ Lazy singleton — one connection, created once
private SQLiteAsyncConnection? _database;
private async Task<SQLiteAsyncConnection> GetDatabaseAsync()
{
    if (_database is not null) return _database;
    _database = new SQLiteAsyncConnection(Constants.DatabasePath, Constants.Flags);
    await _database.ExecuteAsync("PRAGMA journal_mode=WAL;");
    await _database.CreateTableAsync<TodoItem>();
    return _database;
}
❌ Forgetting WAL Mode

Without WAL, readers block writers. Always enable it at initialization:

csharp
await _database.ExecuteAsync("PRAGMA journal_mode=WAL;");
❌ File Operations on Open Database
csharp
// ❌ Moving/deleting while connection is open — data corruption
File.Delete(Constants.DatabasePath);

// ✅ Always close first
await databaseService.CloseConnectionAsync();
if (File.Exists(Constants.DatabasePath))
    File.Delete(Constants.DatabasePath);

Platform Pitfalls

PlatformPitfall
iOSFileSystem.AppDataDirectory is iCloud-backed — use FileSystem.CacheDirectory to exclude DB from iCloud backup
AllMultiple SQLiteAsyncConnection instances to same file → data corruption
AllNo WAL → readers block writers, poor concurrent performance
AllFile operations on open DB → corruption

Decision Framework

QuestionRecommendation
DI lifetime?Singleton — one connection, WAL handles concurrent reads
WAL mode?Always enable — no reason not to on mobile
Database path?FileSystem.AppDataDirectory — never Environment.GetFolderPath
Save pattern?Check Id != 0 → Update, else Insert
Multiple tables?Add all CreateTableAsync<T>() calls in lazy init
Need to export/backup?Close connection first, then File.Copy

Performance Tips

  1. Use transactions for batch writes — individual inserts are slow; wrap in RunInTransactionAsync
  2. Add [Indexed] to frequently queried columns — especially foreign keys
  3. WAL mode eliminates reader/writer contention
  4. Avoid ToListAsync() on large tables — use Where() filtering and pagination
  5. Use raw SQL for complex queries — QueryAsync<T> is faster than chained LINQ for joins

Checklist

  • Install sqlite-net-pcl + SQLitePCLRaw.bundle_green (not Microsoft.Data.Sqlite)
  • Database path uses FileSystem.AppDataDirectory
  • Models have [PrimaryKey, AutoIncrement]
  • Single DatabaseService with lazy async init pattern
  • WAL enabled via PRAGMA journal_mode=WAL
  • DatabaseService registered as singleton in DI
  • Connection closed before any file move/copy/delete
  • iOS: DB excluded from iCloud backup if needed

© davidortinau, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in plugins/maui-skills/skills/maui-sqlite-database of davidortinau/maui-skills.

  • SKILL.md
  • references/sqlite-database-api.md

Open the folder on GitHubat commit 79bb4bf

Compare with similar skills

Maui Sqlite Database next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Maui Sqlite Database compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Maui Sqlite Database this skilldavidortinau/maui-skills174—~1.2kAutomated safety check: PassMIT
NpgsqlrestNpgsqlRest/NpgsqlRest132—~7kAutomated safety check: NotesMIT
C# and .NET DeveloperJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT
Better Drizzlealmeidazs/better-drizzle347—~1.7kAutomated safety check: PassApache-2.0
Prisma Database Setupcurvenote/curvenote1693 repos~1.4kAutomated safety check: PassMIT
Create Auth Skilldeadlock-mod-manager/deadlock-mod-manager5744 repos~3.4kAutomated safety check: PassGPL-3.0

Similar skills

  • Npgsqlrest

    NpgsqlRest/NpgsqlRest

    Build and modify REST APIs with NpgsqlRest — exposing PostgreSQL as HTTP endpoints from two sources (database functions/procedures/tables/views, and plain .sql files), driven by SQL comment…

    132 GitHub stars~7k tokensUpdated 5 days ago
    DatabasesAuto-check: notes
  • C# and .NET Developer

    Jeffallan/claude-skills

    Guides C# work on .NET 8+: ASP.NET Core APIs, Entity Framework Core data access, Blazor apps and CQRS with MediatR, following a five-step build workflow.

    12k GitHub stars~1.3k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Better Drizzle

    almeidazs/better-drizzle

    Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…

    347 GitHub stars~1.7k tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Prisma Database Setup

    curvenote/curvenote

    Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.).

    169 GitHub starsUsed in 3 repos~1.4k tokens
    DatabasesAuto-check passed
  • Create Auth Skill

    deadlock-mod-manager/deadlock-mod-manager

    Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth.

    574 GitHub starsUsed in 4 repos~3.4k tokens
    DatabasesAuto-check passed
  • Drizzle Migrations

    bretzel-app/crumbs

    Drizzle ORM schema management and SQLite migrations — adding tables, modifying columns, creating indexes, generating and running migrations, Drizzle query patterns.

    127 GitHub starsUsed in 1 repo~2.6k tokens
    DatabasesAuto-check passed

More from davidortinau/maui-skills

All 41 skills in this repo
  • Maui Hot Reload Diagnostics

    davidortinau/maui-skills

    Diagnose and troubleshoot .NET MAUI Hot Reload issues (C Hot Reload, XAML Hot Reload, Blazor Hybrid).

    174 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Accessibility

    davidortinau/maui-skills

    Guide for making .NET MAUI apps accessible — screen reader support via SemanticProperties, heading levels, AutomationProperties visibility control, programmatic focus and announcements, and…

    174 GitHub stars~974 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Animations

    davidortinau/maui-skills

    .NET MAUI view animations, custom animations, easing functions, rotation, scale, translation, and fade effects.

    174 GitHub stars~911 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui App Icons Splash

    davidortinau/maui-skills

    .NET MAUI app icon configuration, splash screen setup, SVG to PNG conversion at build time, composed/adaptive icons, and platform-specific icon and splash screen requirements for Android, iOS, Mac…

    174 GitHub stars~995 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui App Lifecycle

    davidortinau/maui-skills

    .NET MAUI app lifecycle guidance covering the four app states (not running, running, deactivated, stopped), cross-platform Window lifecycle events, backgrounding and resume behaviour…

    174 GitHub stars~947 tokensUpdated 3 mo ago
    Auto-check passed
  • Maui Aspire

    davidortinau/maui-skills

    Guide for .NET MAUI apps consuming .NET Aspire-hosted backend services.

    174 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Maui Sqlite Database

What does Maui Sqlite Database do?

Add SQLite local database storage to .NET MAUI apps using sqlite-net-pcl. Maui Sqlite Database is an agent skill from davidortinau/maui-skills.NET MAUI apps using sqlite-net-pcl.

When should I use Maui Sqlite Database?

Maui Sqlite Database fits situations like: : SQLite database; offline storage; database service; createTableAsync.

How do I install Maui Sqlite Database in Claude Code?

Run `npx skills add davidortinau/maui-skills --skill maui-sqlite-database -a claude-code`. Or copy the skill folder (plugins/maui-skills/skills/maui-sqlite-database in davidortinau/maui-skills) into .claude/skills/maui-sqlite-database in your project. Claude Code loads it when a task matches its description.

How do I install Maui Sqlite Database in Codex?

Run `npx skills add davidortinau/maui-skills --skill maui-sqlite-database -a codex`. Or copy the skill folder (plugins/maui-skills/skills/maui-sqlite-database in davidortinau/maui-skills) into .agents/skills/maui-sqlite-database in your project. Codex loads it when a task matches its description.

Can I use Maui Sqlite Database in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davidortinau/maui-skills --skill maui-sqlite-database -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/maui-sqlite-database, .gemini/skills/maui-sqlite-database, .github/skills/maui-sqlite-database and .opencode/skills/maui-sqlite-database in your project.

What does Maui Sqlite Database need to run?

SKILL.md names no scripts, command-line tools or credentials: Maui Sqlite Database is instructions for the agent only.

Does Maui Sqlite Database access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Maui Sqlite Database safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Maui Sqlite Database use?

Maui Sqlite Database is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Maui Sqlite Database use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Maui Sqlite Database?

Skills that share tags, products or a category with Maui Sqlite Database: Npgsqlrest (NpgsqlRest/NpgsqlRest, 132 stars), C# and .NET Developer (Jeffallan/claude-skills, 12k stars), Better Drizzle (almeidazs/better-drizzle, 347 stars) and Prisma Database Setup (curvenote/curvenote, 169 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Maui Sqlite Database?

davidortinau (a GitHub user) maintains it in davidortinau/maui-skills, which has 174 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on July 6, 2026.

Source: davidortinau/maui-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.