mirror of
https://github.com/Phundrak/georm.git
synced 2025-11-30 19:03:59 +00:00
feat: implement preliminary composite primary key support
Add support for entities with composite primary keys using multiple
#[georm(id)] fields. Automatically generates {EntityName}Id structs for
type-safe composite key handling.
Features:
- Multi-field primary key detection and ID struct generation
- Full CRUD operations (find, create, update, delete, create_or_update)
- Proper SQL generation with AND clauses for composite keys
- Updated documNtation in README and lib.rs
Note: Relationships not yet supported for composite key entities
This commit is contained in:
6
tests/fixtures/composite_key.sql
vendored
Normal file
6
tests/fixtures/composite_key.sql
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
INSERT INTO UserRoles (user_id, role_id, assigned_at)
|
||||
VALUES
|
||||
(1, 1, '2024-01-01 10:00:00+00:00'),
|
||||
(1, 2, '2024-01-02 11:00:00+00:00'),
|
||||
(2, 1, '2024-01-03 12:00:00+00:00'),
|
||||
(3, 3, '2024-01-04 13:00:00+00:00');
|
||||
Reference in New Issue
Block a user