Skip to content

Commit

Permalink
Adding Clone to Timestamp and Date types (#700)
Browse files Browse the repository at this point in the history
* Adding Clone trait to pgx::Timestamp object
* Adding Clone for pgx::TimeWithTimeZone
* Adding Clone for pgx::Date
  • Loading branch information
jsaied99 authored Sep 22, 2022
1 parent 47c6747 commit 5fe0b33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pgx/src/datum/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::ffi::CStr;
pub const POSTGRES_EPOCH_JDATE: i32 = pg_sys::POSTGRES_EPOCH_JDATE as i32;
pub const UNIX_EPOCH_JDATE: i32 = pg_sys::UNIX_EPOCH_JDATE as i32;

#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
#[repr(transparent)]
pub struct Date(i32);

Expand Down
2 changes: 1 addition & 1 deletion pgx/src/datum/time_stamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use pgx_utils::sql_entity_graph::metadata::{
};
use std::ffi::CStr;

#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
#[repr(transparent)]
pub struct Timestamp(pg_sys::Timestamp);

Expand Down
2 changes: 1 addition & 1 deletion pgx/src/datum/time_stamp_with_timezone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const PG_EPOCH_DATETIME: time::PrimitiveDateTime = date!(2000 - 01 - 01).midnigh
const MIN_TIMESTAMP_USEC: i64 = -211_813_488_000_000_000;
const END_TIMESTAMP_USEC: i64 = 9_223_371_331_200_000_000 - 1; // dec by 1 to accommodate exclusive range match pattern

#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
#[repr(transparent)]
pub struct TimestampWithTimeZone(pg_sys::TimestampTz);

Expand Down

0 comments on commit 5fe0b33

Please sign in to comment.