We value your privacy

This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content. See our Privacy Policy.

  1. MooseStack
  2. Data Types
  3. String Types

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

On this page

StringLowCardinality(String)UUIDType Mapping ReferenceSee Also
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackHostingTemplatesGuides
Release Notes
Source531
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Language Server
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Dev
  • 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
interface User {  name: string;        // String  email: string;       // String}
import { LowCardinality } from "@514labs/moose-lib"; interface Event {  status: string & LowCardinality;     // LowCardinality(String)  country: string & LowCardinality;    // LowCardinality(String)}
import { tags } from "typia"; interface User {  id: string & tags.Format<"uuid">;    // UUID}