fsharp-persistence
Installation
SKILL.md
F# Persistence Patterns
Philosophy: I/O at the Edges
Persistence is where data meets the outside world. Keep it isolated, explicit about effects, and separate from business logic. The rest of your code should be pure; persistence is where impurity lives.
Before implementing persistence, ask:
- What's the simplest storage that meets the requirements?
- What queries do I need? (Design for access patterns)
- What needs to be transactional?
- How do I handle "not found" vs errors?
Core Principles:
-
Async Everything: All I/O is async. No blocking database calls in an async application.
-
Options for Absence: When something might not exist, return
Option<'T>. Don't return null, don't throw exceptions. -
Parameterized Always: Every query uses parameters. SQL injection is never acceptable.