SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill maui-sqlite-database명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
| name | maui-sqlite-database |
| description | > Use when this capability is needed. |
For full service implementation, constants, data model templates, and common patterns, see references/sqlite-database-api.md.
<!-- ❌ 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.*" />
Environment.GetFolderPath for Database Path// ❌ 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");
SQLiteAsyncConnection is not thread-safe for multiple instances pointing at the same file. Use a single instance via DI singleton:
// ❌ 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;
}
Without WAL, readers block writers. Always enable it at initialization:
await _database.ExecuteAsync("PRAGMA journal_mode=WAL;");
// ❌ 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 | Pitfall |
|---|---|
| iOS | FileSystem.AppDataDirectory is iCloud-backed — use FileSystem.CacheDirectory to exclude DB from iCloud backup |
| All | Multiple SQLiteAsyncConnection instances to same file → data corruption |
| All | No WAL → readers block writers, poor concurrent performance |
| All | File operations on open DB → corruption |
| Question | Recommendation |
|---|---|
| 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 |
RunInTransactionAsync[Indexed] to frequently queried columns — especially foreign keysToListAsync() on large tables — use Where() filtering and paginationQueryAsync<T> is faster than chained LINQ for joinssqlite-net-pcl + SQLitePCLRaw.bundle_green (not Microsoft.Data.Sqlite)FileSystem.AppDataDirectory[PrimaryKey, AutoIncrement]DatabaseService with lazy async init patternPRAGMA journal_mode=WALDatabaseService registered as singleton in DIConverted and distributed by TomeVault — claim your Tome and manage your conversions.