sqlalchemy-patterns SKILL.md skillA
sqlalchemy-patterns from omarsaleh506/skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add omarsaleh506/skills/sqlalchemy-patterns@git:20261006.98751ebPins git:20261006.98751eb in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- omarsaleh506/skills
- Path
skills/sqlalchemy-patterns/SKILL.md- Versions recorded
- 4
- Latest version
- git:20261006.98751eb, committed Oct 6, 2026
- First version recorded
- Jun 28, 2026
- Size
- 15,072 bytes
- Repository stars
- 3
- License
- MIT
Comprehensive SQLAlchemy 2.0+ async + PostgreSQL patterns — declarative models, relationships, type-safe Mapped[ columns, querying, eager loading, transactions, and Alembic migrations. Use when working with SQLAlchemy; to write a model, declarative model, or ORM model; add a column, mapped_column, or Mapped[ annotation; define a relationship, foreign key, or index on a table; choose selectinload, joinedload, or load_only; configure an async session or call session.execute; fix N+1 queries; do…
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# SQLAlchemy 2.0+ Patterns (Async · PostgreSQL) Rules for writing SQLAlchemy 2.0 / 2.1 code where **PostgreSQL is the database and async is the execution model**. Everything here is 2.0-style — no legacy `Column()` class attributes, `session.query()`, or `declarative_base()`. > Project-agnostic: examples use generic names (`User`, `Order`). Adapt names to the project; never copy example session names or pool numbers as if they were rules. **Versions:** works on SQLAlchemy 2.0 and 2.1 (current release line). On 2.1: Python ≥ 3.11, install `sqlalchemy[asyncio]` (greenlet is no longer pulled in by default), and always name the driver in the URL (`postgresql+asyncpg://` / `postgresql+psycopg://`). Upgrade notes: `references/migration-2.1.md`. --- ## Quick Reference Cheatsheet | Rule | Do this | |---|---| | Base class | `class Base(AsyncAttrs, DeclarativeBase)` — never `declarative_base()` | | Columns | `mapped_column()` + `Mapped[T]` — never bare `Column()` on a mapped class | | Nullable | `Mapped[str]` = NOT NULL · `Mapped[str \| None]` = NULL | | UUID PK | `Mapped[uuid.UUID] = mapped_column(primary_key=True, default=uuid4)` (maps to `Uuid` automatically) | …
Read the whole file at its exact version.
How to install
mdr add omarsaleh506/skills/sqlalchemy-patterns@sha256:28968f9757c51af0The line at the top of this page pins the label git:20261006.98751eb, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_g5kuy7zlnzscackp)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 4 versions of this file, between Jun 28, 2026 and Oct 6, 2026, about one every 33 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261006.98751eb latest | 2026-10-06 | 98751eb | 15,072 B | A | view · diff |
| git:20260629.89b93c6 | 2026-06-29 | 89b93c6 | 43,102 B | A | view · diff |
| git:20260628.4788b85 | 2026-06-28 | 4788b85 | 42,976 B | A | view · diff |
| git:20260628.96e2c51 | 2026-06-28 | 96e2c51 | 42,869 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (15072 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
omarsaleh506/skills · 3 stars · license MIT · pushed 2026-10-07 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_g5kuy7zlnzscackp GET https://markdownregistry.com/api/v1/resolve?ref=omarsaleh506/skills/sqlalchemy-patterns GET https://markdownregistry.com/api/v1/blob/28968f9757c51af04d3584f014ae9a4eb82183c3d0a842ff68bb72bda2c9eae4
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.