Support for composite Primary Keys

Đang mở
#488 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
database

Hướng nghiên cứu

Start by reading the model attribute handling and primary-key representation in the ORM; the issue does not name specific files or tests. Then trace how #[model(primary_key)] and ForeignKey are processed, and identify where a tuple-valued logical key would affect the model. Done means composite keys are supported as described and covered by tests; this issue has had no comments for over 180 days.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

For now there's only support for a single field as a primary key. Would be nice to have a composite_primary_key attribute as well. Ideally, this should inherently create a logical key(eg. pk) that is a tuple of the composites.

#[model]
struct Bar{
   #[model(primary_key)]
   id: Auto<u32>
}

#[model]
struct Baz{
    #[model(primary_key)
    id: Auto<u32>
} 

#[model]
struct Foo{
   #[model(composite_key)]
   bar: ForeignKey<Bar>,
   #[model(composite_key)]
   baz: ForeignKey<Baz>,
} 
Ngôn ngữ chính
Rust
Star
1.1k
Fork
57
Merge trung bình
17 giờ 39 phút
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cot-rs/cot

Tất cả issue của cot-rs/cot

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.