FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplatesGuides
Release Notes
Source514
  1. MooseStack
  2. Data Types

On this page

Type CategoriesBasic TypesComplex TypesSpecial TypesSchema FeaturesQuick 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

    Schema Features

    • Column Comments — Add descriptions to columns that appear in ClickHouse DDL

    Quick Reference

    CategoryTypeScriptPython
    Stringstringstr
    IntegerInt32, UInt64, etc.Annotated[int, "int32"]
    FloatFloat32, Float64, numberfloat
    Booleanbooleanbool
    DateDate, DateTimedate, datetime
    ArrayT[]

    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
    • Add column comments to document field purposes in your schema
    List[T]
    MapRecord<K, V>Dict[K, V]
    Optionalfield?: TOptional[T]
    • Overview
    Build a New App
    • 5 Minute Quickstart
    • Browse Templates
    • Existing ClickHouse
    Add to Existing App
    • Next.js
    • Fastify
    Fundamentals
    • Moose Runtime
    • MooseDev MCP
    • Data Modeling
    Moose Modules
    • Moose OLAP
    • Moose Streaming
    • Moose Workflows
    • Moose APIs & Web Apps
    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
    • Release Notes
    Contribution
    • Documentation
    • Framework