1. MooseStack
  2. Data Types
  3. String Types

On this page

StringLowCardinality(String)UUIDType Mapping ReferenceSee Also

String Types

ClickHouse provides several string-based types optimized for different use cases.

String

Variable-length strings for general text data.

interface User {  name: string;        // String  email: string;       // String}

LowCardinality(String)

Optimized storage for strings with many repeated values. Use when you have fewer than ~10,000 unique values.

import { LowCardinality } from "@514labs/moose-lib"; interface Event {  status: string & LowCardinality;     // LowCardinality(String)  country: string & LowCardinality;    // LowCardinality(String)}
When to use LowCardinality

Use LowCardinality for columns like status codes, country codes, categories, or any string field with a limited set of repeated values. It significantly reduces storage and improves query performance.

UUID

Universally unique identifiers stored in native UUID format.

import { tags } from "typia"; interface User {  id: string & tags.Format<"uuid">;    // UUID}

Type Mapping Reference

ClickHouse TypeTypeScriptPython
Stringstringstr
LowCardinality(String)string & LowCardinalityAnnotated[str, "LowCardinality"]
UUIDstring & tags.Format<"uuid">UUID

See Also

  • LowCardinality — Detailed guide for optimizing repeated string values
  • Enums — Fixed categorical values
  • ClickHouse String — ClickHouse official documentation
  • 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