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    pub verified: Option<OffsetDateTime>,
36}
37
38pub struct Session {
39    pub id: i64,
40    pub user_id: i64,
41    pub token: String,
42}
43
44pub struct NewUser {
45    pub username: String,
46    pub email: String,
47    pub password: String,
48}
49
50pub struct NewSession {
51    pub user_id: i64,
52    pub token: String,
53}