diff options
| author | John Oxley <john.oxley@gmail.com> | 2026-05-15 00:07:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-14 23:07:08 +0000 |
| commit | 27cf6d2af5ae1a4884164d3b0ca44fbbf4a8fab1 (patch) | |
| tree | 9dd9d7b90b35d2eabaf754d83831fb15bd5164af /crates/atuin-server-sqlite/src/lib.rs | |
| parent | chore: vouch for all existing contributors (#3486) (diff) | |
| download | atuin-27cf6d2af5ae1a4884164d3b0ca44fbbf4a8fab1.zip | |
refactor: pull `fn into_utc` into atuin-server-database crate (#3487)
The `fn into_utc` was defined in both `atuin-server-postgres` and
`atuin-server-sqlite`, with tests being in the postgres crate. This
pulls the function into the `atuin-server-database` crate along with the
tests and references it from both crates.
## Checks
- [X] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [X] I have checked that there are no existing pull requests for the
same thing
Diffstat (limited to '')
| -rw-r--r-- | crates/atuin-server-sqlite/src/lib.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/crates/atuin-server-sqlite/src/lib.rs b/crates/atuin-server-sqlite/src/lib.rs index 7d4dcb86..56ed9b6c 100644 --- a/crates/atuin-server-sqlite/src/lib.rs +++ b/crates/atuin-server-sqlite/src/lib.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use async_trait::async_trait; use atuin_common::record::{EncryptedData, HostId, Record, RecordIdx, RecordStatus}; use atuin_server_database::{ - Database, DbError, DbResult, DbSettings, + Database, DbError, DbResult, DbSettings, into_utc, models::{History, NewHistory, NewSession, NewUser, Session, User}, }; use futures_util::TryStreamExt; @@ -12,7 +12,6 @@ use sqlx::{ sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions}, types::Uuid, }; -use time::{OffsetDateTime, PrimitiveDateTime, UtcOffset}; use tracing::instrument; use wrappers::{DbHistory, DbRecord, DbSession, DbUser}; @@ -429,8 +428,3 @@ impl Database for Sqlite { .map(|DbHistory(h)| h) } } - -fn into_utc(x: OffsetDateTime) -> PrimitiveDateTime { - let x = x.to_offset(UtcOffset::UTC); - PrimitiveDateTime::new(x.date(), x.time()) -} |
