pub struct PartitionDescriptor {
pub pointer: String,
pub interval: PartitionInterval,
pub premake: u32,
pub retention: Option<u32>,
}Expand description
Declarative range partitioning for one type, maintained by pg_partman.
A type carries at most one of these: a table has exactly one partition
key, so a second declaration isn’t a refinement, it’s a contradiction.
See validate_partitions.
Fields§
§pointer: StringThe property partitioned on. Must be a non-nullable date/timestamp property of this type — PostgreSQL requires the partition key to be part of the primary key and to never be NULL.
interval: PartitionInterval§premake: u32How many future partitions to keep pre-created. A write landing in a range that doesn’t exist yet fails, so this is the safety margin against maintenance falling behind.
retention: Option<u32>Drop partitions older than this many intervals. None keeps
everything — the safe default, since the alternative silently deletes
data on a schedule.
Implementations§
Source§impl PartitionDescriptor
impl PartitionDescriptor
Sourcepub fn retention_interval(&self) -> Option<String>
pub fn retention_interval(&self) -> Option<String>
retention as a PostgreSQL interval literal, for part_config.
Trait Implementations§
Source§impl Clone for PartitionDescriptor
impl Clone for PartitionDescriptor
Source§impl Debug for PartitionDescriptor
impl Debug for PartitionDescriptor
Source§impl<'de> Deserialize<'de> for PartitionDescriptor
impl<'de> Deserialize<'de> for PartitionDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PartitionDescriptor
impl RefUnwindSafe for PartitionDescriptor
impl Send for PartitionDescriptor
impl Sync for PartitionDescriptor
impl Unpin for PartitionDescriptor
impl UnsafeUnpin for PartitionDescriptor
impl UnwindSafe for PartitionDescriptor
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.