1. MooseStack
  2. Data Types
  3. Network Types

IPAddress Types

ClickHouse provides native IP address types for efficient storage and querying.

IPv4

Stores IPv4 addresses in 4 bytes.

import { tags } from "typia"; interface NetworkEvent {  source_ip: string & tags.Format<"ipv4">;    // IPv4  client_ip: string & tags.Format<"ipv4">;    // IPv4}

IPv6

Stores IPv6 addresses in 16 bytes. Also handles IPv4-mapped IPv6 addresses.

import { tags } from "typia"; interface NetworkEvent {  dest_ip: string & tags.Format<"ipv6">;    // IPv6}

Type Mapping Reference

ClickHouse TypeTypeScriptPython
IPv4string & tags.Format<"ipv4">IPv4Address
IPv6string & tags.Format<"ipv6">IPv6Address
Why use native IP types?

Native IP types are more storage-efficient than strings and enable IP-specific functions like range queries, subnet matching, and CIDR operations directly in ClickHouse.

See Also

  • ClickHouse IPv4 — ClickHouse official documentation
  • ClickHouse IPv6 — ClickHouse official documentation

On this page

IPv4IPv6Type Mapping ReferenceSee Also
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplatesGuides
Release Notes
Source523
  • 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
import { tags } from "typia"; interface NetworkEvent {  source_ip: string & tags.Format<"ipv4">;    // IPv4  client_ip: string & tags.Format<"ipv4">;    // IPv4}
import { tags } from "typia"; interface NetworkEvent {  dest_ip: string & tags.Format<"ipv6">;    // IPv6}