Last active
March 18, 2018 03:57
-
-
Save sean3z/f50da005c0fd10537650ff0fe769b26c to your computer and use it in GitHub Desktop.
bind our struct to our table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use diesel; | |
| use diesel::prelude::*; | |
| use diesel::mysql::MysqlConnection; | |
| use schema::heroes; | |
| #[table_name = "heroes"] | |
| #[derive(Serialize, Deserialize, Queryable, Insertable)] | |
| pub struct Hero { | |
| pub id: Option<i32>, | |
| pub name: String, | |
| pub identity: String, | |
| pub hometown: String, | |
| pub age: i32 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment