From 97f207b771b94c5285faae4810d6eeda1b78926b Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 11 Jun 2026 16:10:29 +0200 Subject: chore(server): Simplify the database support --- crates/turtle/src/atuin_server/database/models.rs | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 crates/turtle/src/atuin_server/database/models.rs (limited to 'crates/turtle/src/atuin_server/database/models.rs') diff --git a/crates/turtle/src/atuin_server/database/models.rs b/crates/turtle/src/atuin_server/database/models.rs new file mode 100644 index 00000000..e47d614d --- /dev/null +++ b/crates/turtle/src/atuin_server/database/models.rs @@ -0,0 +1,52 @@ +use time::OffsetDateTime; + +pub(crate) struct History { + pub(crate) id: i64, + pub(crate) client_id: String, // a client generated ID + pub(crate) user_id: i64, + pub(crate) hostname: String, + pub(crate) timestamp: OffsetDateTime, + + /// All the data we have about this command, encrypted. + /// + /// Currently this is an encrypted msgpack object, but this may change in the future. + pub(crate) data: String, + + pub(crate) created_at: OffsetDateTime, +} + +pub(crate) struct NewHistory { + pub(crate) client_id: String, + pub(crate) user_id: i64, + pub(crate) hostname: String, + pub(crate) timestamp: OffsetDateTime, + + /// All the data we have about this command, encrypted. + /// + /// Currently this is an encrypted msgpack object, but this may change in the future. + pub(crate) data: String, +} + +pub(crate) struct User { + pub(crate) id: i64, + pub(crate) username: String, + pub(crate) email: String, + pub(crate) password: String, +} + +pub(crate) struct Session { + pub(crate) id: i64, + pub(crate) user_id: i64, + pub(crate) token: String, +} + +pub(crate) struct NewUser { + pub(crate) username: String, + pub(crate) email: String, + pub(crate) password: String, +} + +pub(crate) struct NewSession { + pub(crate) user_id: i64, + pub(crate) token: String, +} -- cgit v1.3.1