Skip to main content

atuin_server_database/
models.rs

1use time::OffsetDateTime;
2
3pub struct History {
4    pub id: i64,
5    pub client_id: String, // a client generated ID
6    pub user_id: i64,
7    pub hostname: String,
8    pub timestamp: OffsetDateTime,
9
10    /// All the data we have about this command, encrypted.
11    ///
12    /// Currently this is an encrypted msgpack object, but this may change in the future.
13    pub data: String,
14
15    pub created_at: OffsetDateTime,
16}
17
18pub struct NewHistory {
19    pub client_id: String,
20    pub user_id: i64,
21    pub hostname: String,
22    pub timestamp: OffsetDateTime,
23
24    /// All the data we have about this command, encrypted.
25    ///
26    /// Currently this is an encrypted msgpack object, but this may change in the future.
27    pub data: String,
28}
29
30pub struct User {
31    pub id: i64,
32    pub username: String,
33    pub email: String,
34    pub password: String,
35}
36
37pub struct Session {
38    pub id: i64,
39    pub user_id: i64,
40    pub token: String,
41}
42
43pub struct NewUser {
44    pub username: String,
45    pub email: String,
46    pub password: String,
47}
48
49pub struct NewSession {
50    pub user_id: i64,
51    pub token: String,
52}