Data Modeling#

Advanced Alchemy provides declarative base classes, column mixins, and dialect-portable column types for primary keys, audit timestamps, encrypted fields, password hashes, and object storage.

Modeling Basics

Pick a base class for integer or UUID keys, add URL slugs, and wire relationships between tables.

Modeling Basics
Table Inheritance

Share columns across related models using single-table, joined-table, or concrete-table layouts.

Inheritance Patterns
Portable Column Types

Store UTC timestamps, UUIDs, JSON documents, and vector embeddings that work across SQLite and production SQL engines.

Portable Column Types
Security & File Storage

Encrypt sensitive strings, hash passwords, verify one-time codes, and attach uploaded files to rows.

Security and File Storage Types