Closed Raj2032 closed 2 months ago
Forgive me for my lack of understanding but I am here to seek advise:
Lets say I had this structure:
pub struct Customer { pub id: u32, pub name: Name, pub email: String, pub is_disabled: bool, } pub struct Name { first: String, last: String, } let customer_1 = Customer{id: 0, name: Name{first: "John", last: "Doe"}, email: "someemail@gmail.com", is_disabled: false};
Where I want to insert customer_1 as a row into a table. Is this possible first of all?
customer_1
And lets say I have another structure:
pub struct Issue { pub customer_id: u32, // Foreign key to Customer id pub issue_id: u32, pub description: String, pub pricing: f32, }
Would I be able to have primary and foreign keys that would link Issue table with Customer table and be able to query it?
Issue
Customer
Forgive me for my lack of understanding but I am here to seek advise:
Lets say I had this structure:
Where I want to insert
customer_1
as a row into a table. Is this possible first of all?And lets say I have another structure:
Would I be able to have primary and foreign keys that would link
Issue
table withCustomer
table and be able to query it?