Module: ClickhouseRuby::Types
- Defined in:
- lib/clickhouse_ruby/types.rb,
lib/clickhouse_ruby/types/map.rb,
lib/clickhouse_ruby/types/base.rb,
lib/clickhouse_ruby/types/uuid.rb,
lib/clickhouse_ruby/types/array.rb,
lib/clickhouse_ruby/types/float.rb,
lib/clickhouse_ruby/types/tuple.rb,
lib/clickhouse_ruby/types/parser.rb,
lib/clickhouse_ruby/types/string.rb,
lib/clickhouse_ruby/types/boolean.rb,
lib/clickhouse_ruby/types/integer.rb,
lib/clickhouse_ruby/types/nullable.rb,
lib/clickhouse_ruby/types/registry.rb,
lib/clickhouse_ruby/types/date_time.rb,
lib/clickhouse_ruby/types/low_cardinality.rb
Overview
Type system for mapping between ClickHouse and Ruby types
Key features:
-
AST-based type parser (handles nested types correctly)
-
Bidirectional conversion (Ruby ↔ ClickHouse)
-
Proper handling of complex types (Array, Map, Tuple, Nullable)
Defined Under Namespace
Classes: Array, Base, Boolean, DateTime, Float, Integer, LowCardinality, Map, Nullable, Parser, Registry, String, Tuple, UUID
Class Method Summary collapse
-
.lookup(type_string) ⇒ Base
Looks up a type by its ClickHouse type string.
-
.parse(type_string) ⇒ Hash
Parses a ClickHouse type string into an AST.
-
.registry ⇒ Registry
Returns the global type registry.
-
.reset! ⇒ Object
Resets the registry (useful for testing).
Class Method Details
.lookup(type_string) ⇒ Base
Looks up a type by its ClickHouse type string
51 52 53 |
# File 'lib/clickhouse_ruby/types.rb', line 51 def lookup(type_string) registry.lookup(type_string) end |
.parse(type_string) ⇒ Hash
Parses a ClickHouse type string into an AST
59 60 61 |
# File 'lib/clickhouse_ruby/types.rb', line 59 def parse(type_string) Parser.new.parse(type_string) end |
.registry ⇒ Registry
Returns the global type registry
43 44 45 |
# File 'lib/clickhouse_ruby/types.rb', line 43 def registry @registry ||= Registry.new.tap(&:register_defaults) end |
.reset! ⇒ Object
Resets the registry (useful for testing)
64 65 66 |
# File 'lib/clickhouse_ruby/types.rb', line 64 def reset! @registry = nil end |