Configure your Moose projects using .env files with proper precedence (.env < .env.dev < .env.local). This makes it easier to manage different configurations across environments without hardcoding values.
# Create .env files in your Moose project root
# Base configuration (lowest precedence)
echo "MOOSE_HTTP_SERVER_CONFIG__PORT=3000
MOOSE_CLICKHOUSE_CONFIG__HOST=localhost
MOOSE_CLICKHOUSE_CONFIG__PORT=9000" > .env
# Development-specific overrides
echo "MOOSE_HTTP_SERVER_CONFIG__PORT=3001
MOOSE_LOGGER__LEVEL=debug
MOOSE_CLICKHOUSE_CONFIG__DB_NAME=myproject_dev" > .env.dev
# Local overrides (highest precedence, gitignored)
echo "MOOSE_HTTP_SERVER_CONFIG__PORT=3002
MOOSE_CLICKHOUSE_CONFIG__HOST=127.0.0.1
MOOSE_REDIS_CONFIG__URL=redis://localhost:6380" > .env.local
# Start development server - automatically loads .env files
# Precedence: .env < .env.dev < .env.local
moose dev
# For production deployment, only .env is loaded
moose prodPR: #2936 | Docs: Environment variables
Support for FixedString(N) data type in data models, allowing you to define fixed-length string columns for optimized storage of data like hashes, IP addresses, and MAC addresses.
export interface NetworkEvent { id: string; timestamp: Date; // Fixed-length string for MD5 hash (32 hex chars = 16 bytes) md5_hash: string & FixedString<16>; // Fixed-length string for IPv6 address (16 bytes) ipv6_address: string & FixedString<16>; // Fixed-length string for MAC address (17 chars: XX:XX:XX:XX:XX:XX) mac_address: string & FixedString<17>; // Array of MAC addresses for network devices connected_devices: (string & FixedString<17>)[]; // Regular string for variable-length data user_agent: string; // Other fields bytes_transferred: number; is_encrypted: boolean;}PR: #2939 | Docs: FixedString type | ClickHouse FixedString
Configure the migration system to ignore PARTITION BY changes when comparing database schemas. This prevents unnecessary table recreations when partition changes are intentionally ignored.
[migration_config]ignore_operations = ["ModifyPartitionBy"]PR: #2928 | Docs: Ignoring operations
New type aliases for ClickHouse numeric types in Python: Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Float32, and Float64. These provide better type safety and clearer intent when defining data models.
from moose_lib import ( Key, IngestPipeline, IngestPipelineConfig, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Float32, Float64)from pydantic import BaseModelfrom datetime import datetimefrom typing import Optional class UserActivity(BaseModel): user_id: Key[UInt64] # User IDs are always positive, use UInt64 for large scale event_time: datetime page_views: UInt32 # Daily page views (0 to 4 billion) session_duration: UInt16 # Session length in seconds (0 to 65K seconds) score_delta: Int32 # Score changes can be positive or negative latitude: Float64 # GPS coordinates need high precision longitude: Float64 # GPS coordinates need high precision confidence: Float32 # ML confidence scores (lower precision acceptable)PR: #2945 | Docs: Numeric types