You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Session::flush uses RelationshipInfo to plan explicit dependent DELETEs (Active) and detach loaded children after parent delete (Passive), including composite FK tuples and composite many-to-many link-table deletes
Note: Relationships are handled differently in Rust: prefer explicit load/batch-load (Lazy<T>, Session::load_many_to_many) or explicit JOIN queries rather than implicit N+1 behavior.
10. Serialization (via Serde)
Feature
Python
Rust
Status
To dict/struct
model_dump()
Native struct
✅ N/A
To JSON
model_dump_json()
serde_json::to_string()
✅ Complete
From dict
Model(**dict)
Model { ... }
✅ N/A
From JSON
model_validate_json()
serde_json::from_str()
✅ Complete
Exclude fields
exclude=
#[serde(skip)]
✅ Complete
Rename fields
alias=
#[serde(rename = "...")]
✅ Complete
11. Database Drivers
Driver
Python
Rust
Status
SQLite
Via SQLAlchemy
sqlmodel-sqlite
✅ Complete
MySQL
Via SQLAlchemy
sqlmodel-mysql
✅ Complete
PostgreSQL
Via SQLAlchemy
sqlmodel-postgres
✅ Complete
Prepared statements
Automatic
Binary protocol
✅ Complete
TLS/SSL
Engine config
Feature-gated (rustls)
✅ Complete
Connection string
URL parsing
Config struct
✅ Complete
MySQL Driver Details (sqlmodel-mysql)
Feature
Status
Notes
Wire protocol
✅ Complete
Full MySQL protocol implementation
Authentication
✅ Complete
mysql_native_password, caching_sha2_password
TLS/SSL
✅ Complete
Via rustls (SslMode::Disable/Preferred/Required/VerifyCa/VerifyIdentity)
Prepared statements
✅ Complete
Binary protocol with COM_STMT_PREPARE/EXECUTE
Async connection
✅ Complete
Via asupersync TCP primitives
Packet fragmentation
✅ Complete
Handles TCP packet splitting
Connection pooling
✅ Complete
Via sqlmodel-pool
PostgreSQL Driver Details (sqlmodel-postgres)
Feature
Status
Notes
Wire protocol
✅ Complete
Full Postgres protocol
Authentication
✅ Complete
MD5, SCRAM-SHA-256
TLS/SSL
✅ Complete
Via rustls
Prepared statements
✅ Complete
Named statements
Transactions
✅ Complete
All isolation levels
Type conversion
✅ Complete
All major types
SQLite Driver Details (sqlmodel-sqlite)
Feature
Status
Notes
In-memory DB
✅ Complete
:memory: support
File DB
✅ Complete
File path support
Transactions
✅ Complete
Via sqlite3
Concurrent access
✅ Complete
Via mutex
12. Connection Pooling
Feature
Python
Rust
Status
Pool creation
create_engine(pool_size=)
Pool::new(config)
✅ Complete
Min/max connections
Engine config
PoolConfig
✅ Complete
Acquire connection
Automatic
pool.acquire()
✅ Complete
Release connection
Automatic
RAII (drop)
✅ Complete
Health checks
Optional
test_on_checkout
✅ Complete
Idle timeout
Engine config
idle_timeout
✅ Complete
Max lifetime
Engine config
max_lifetime
✅ Complete
Pool statistics
N/A
pool.stats()
✅ Complete
Critical Missing Features
Priority 1 (Should Implement)
1. #[derive(Validate)] macro - Generates validation logic at compile time ✅ IMPLEMENTED
✅ Numeric constraints (min, max)
✅ String constraints (min_length, max_length)
✅ Custom validator methods
✅ Full regex patterns (#[validate(pattern = \"...\")]) with compile-time pattern validation
The Rust SQLModel implementation covers the core ORM functionality (Model derive, query building, CRUD operations, transactions, connection pooling, validation). Remaining parity work is tracked in Beads under bd-162.
Fully Production-Ready
All 3 database drivers - PostgreSQL, MySQL, SQLite fully functional
Complete query builder - SELECT, INSERT, UPDATE, DELETE with all operators
Full transaction support - Isolation levels, savepoints, auto-rollback
Connection pooling - All configuration options, health checks, statistics
TLS/SSL - Implemented for MySQL and PostgreSQL via rustls
Prepared statements - MySQL binary protocol, PostgreSQL named statements