advanced-alchemy-types
Installation
SKILL.md
Types
Execution Workflow
- Choose the column type based on storage semantics, not convenience.
- Use
DateTimeUTCfor timezone-aware timestamps that must normalize to UTC. - Use
EncryptedStringorEncryptedTextonly after choosing the encryption backend and key source. - Use
GUID,JsonB,PasswordHash, andStoredObjectwhere the database contract truly requires them. - Check migration and dialect behavior before committing to a custom type in a widely used model.
Implementation Rules
- Require timezone-aware input for UTC datetime fields.
- Never hardcode real encryption keys in model definitions.
- Keep type constructor arguments hashable and cache-safe when custom decorators participate in SQLAlchemy statement caching.
- Treat file-object and password-hash columns as lifecycle-bearing fields, not plain strings.