1. MooseStack
  2. Data Types

On this page

Type CategoriesBasic TypesComplex TypesSpecial TypesQuick ReferenceBest Practices

Data Types

Moose supports a comprehensive set of ClickHouse column types across both TypeScript and Python. This section covers all supported types, their syntax, and how they map to ClickHouse.

Type Categories

Basic Types

  • Strings — String, LowCardinality(String), UUID
  • Integers — Int8 to Int64, UInt8 to UInt64
  • Floats — Float32, Float64
  • Decimals — Fixed-point Decimal(P,S)
  • Booleans — Boolean
  • Date & Time — Date, DateTime, DateTime64
  • Network — IPv4, IPv6

Complex Types
  • Arrays — Array(T)
  • Maps — Map(K, V)
  • Nested — Embedded objects
  • Tuples — Named tuples
  • Enums — Enumerated values
  • Geometry — Point, Ring, Polygon, etc.

Special Types

  • JSON — Dynamic and typed JSON columns
  • Nullable — Optional fields
  • Aggregates — SimpleAggregateFunction for pre-aggregation

Quick Reference

CategoryTypeScriptPython
Stringstringstr
IntegerInt32, UInt64, etc.Annotated[int, "int32"]
FloatFloat32, Float64, numberfloat
Booleanbooleanbool
DateDate, DateTimedate, datetime
ArrayT[]List[T]
MapRecord<K, V>Dict[K, V]
Optionalfield?: TOptional[T]

Best Practices

  • Use specific integer types when you know the value ranges to save storage
  • Prefer Float64 for most floating-point calculations unless storage is critical
  • Use LowCardinality for string columns with repeated values (< 10,000 unique)
  • Choose appropriate DateTime precision based on your accuracy needs
  • Order columns by cardinality (low to high) for better compression
  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
    • Strings
    • LowCardinality
    • Integers
    • Floats
    • Decimals
    • Booleans
    • Date & Time
    • Network
    • Arrays
    • Maps
    • Nested
    • Tuples
    • Enums
    • Geometry
    • JSON
    • Nullable
    • Aggregates
  • Table Engines
  • CLI
  • Configuration
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506