1
use canyon_sql::macros::*;
2

            
3
303
#[derive(Debug, Clone, Fields, CanyonCrud, CanyonMapper, Eq, PartialEq)]
4
#[canyon_entity]
5
/// Data model that represents a database entity for Players.
6
///
7
/// For test the behaviour of Canyon with entities that no declares primary keys,
8
/// or that is configuration isn't autoincremental, we will use this class.
9
/// Note that this entity has a primary key declared in the database, but we will
10
/// omit this in Canyon, so for us, is like if the primary key wasn't set up.
11
///
12
/// Remember that the entities that does not declares at least a field as `#[primary_key]`
13
/// does not have all the CRUD operations available, only the ones that doesn't
14
/// requires of a primary key.
15
pub struct Player {
16
    // #[primary_key]  We will omit this to use it as a mock of entities that doesn't declares primary key
17
    id: i32,
18
    ext_id: i64,
19
    first_name: String,
20
    last_name: String,
21
    summoner_name: String,
22
    image_url: Option<String>,
23
    role: String,
24
}