-- Partition-based archival strategy
-- Create partitioned table
CREATE TABLE logs (
id BIGSERIAL,
level VARCHAR(20),
-- PostgreSQL Declarative Partitioning (10+)
-- Create partitioned table by date range
CREATE TABLE measurements (
id BIGSERIAL,
sensor_id INT NOT NULL,
#[derive(Debug, Clone)]
pub struct Order {
pub id: u64,
pub amount_cents: i64,
pub currency: [u8; 3],
}