What problem does it solve? Writing correct database logic inside Appflare handlers requires knowing the typed ctx.db API: which where operators exist, how to load relations, how to paginate, and how to keep concurrent writes atomic. This Skill teaches an AI agent those patterns so it generates correct queries, filters, aggregates, and multi-table writes instead of guessing. ## Core Features & Use Cases - Typed reads and filters: findMany and findFirst with operators like eq, in, gt, contains, exists, geoWithin, and/or/not combinators, relation loading with "with", orderBy, limit/offset, iterate, and cursor pagination. - Safe writes and concurrency: insert with nested relations, update with increment/decrement expressions, expectRows guards, atomic batch and transaction writes, upsert, and delete with ownership scoping. - Aggregates: count, sum, avg, min, max, and groupBy for dashboard-style statistics. - Use Case: While building a mutation handler that transfers balance between two accounts, the agent uses decrement with an expectRows guard inside ctx.db.batch so the transfer is atomic and fails cleanly on insufficient funds. ## Quick Start Ask the agent to write an Appflare query handler that lists a project's open tasks with assignee relations, search filtering, and cursor pagination using ctx.db.