diff options
Diffstat (limited to 'atuin-client/src')
| -rw-r--r-- | atuin-client/src/history.rs | 6 | ||||
| -rw-r--r-- | atuin-client/src/import/resh.rs | 6 | ||||
| -rw-r--r-- | atuin-client/src/message.rs | 5 |
3 files changed, 11 insertions, 6 deletions
diff --git a/atuin-client/src/history.rs b/atuin-client/src/history.rs index a710db2b..bb50a02a 100644 --- a/atuin-client/src/history.rs +++ b/atuin-client/src/history.rs @@ -3,7 +3,7 @@ use std::env; use chrono::Utc; use serde::{Deserialize, Serialize}; -use atuin_common::utils::uuid_v4; +use atuin_common::utils::uuid_v7; // Any new fields MUST be Optional<>! #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, sqlx::FromRow)] @@ -48,12 +48,12 @@ impl History { ) -> Self { let session = session .or_else(|| env::var("ATUIN_SESSION").ok()) - .unwrap_or_else(uuid_v4); + .unwrap_or_else(|| uuid_v7().as_simple().to_string()); let hostname = hostname.unwrap_or_else(|| format!("{}:{}", whoami::hostname(), whoami::username())); Self { - id: uuid_v4(), + id: uuid_v7().as_simple().to_string(), timestamp, command, cwd, diff --git a/atuin-client/src/import/resh.rs b/atuin-client/src/import/resh.rs index 41f54836..6fa27b5a 100644 --- a/atuin-client/src/import/resh.rs +++ b/atuin-client/src/import/resh.rs @@ -6,7 +6,7 @@ use directories::UserDirs; use eyre::{eyre, Result}; use serde::Deserialize; -use atuin_common::utils::uuid_v4; +use atuin_common::utils::uuid_v7; use super::{get_histpath, unix_byte_lines, Importer, Loader}; use crate::history::History; @@ -123,13 +123,13 @@ impl Importer for Resh { }; h.push(History { - id: uuid_v4(), + id: uuid_v7().as_simple().to_string(), timestamp, duration, exit: entry.exit_code, command: entry.cmd_line, cwd: entry.pwd, - session: uuid_v4(), + session: uuid_v7().as_simple().to_string(), hostname: entry.host, deleted_at: None, }) diff --git a/atuin-client/src/message.rs b/atuin-client/src/message.rs new file mode 100644 index 00000000..1c34ee4e --- /dev/null +++ b/atuin-client/src/message.rs @@ -0,0 +1,5 @@ + +pub struct Message { + pub id: Uuid, + pub type: String, +} |
