Ralph::Schema::Validator
Validates model schemas against database schema
Constants
PG_TYPE_TO_CRYSTAL = {"smallint" => ["Int16", "Int32"], "integer" => ["Int32"], "bigint" => ["Int64"], "int2" => ["Int16", "Int32"], "int4" => ["Int32"], "int8" => ["Int64"], "serial" => ["Int32"], "bigserial" => ["Int64"], "smallserial" => ["Int16", "Int32"], "real" => ["Float32"], "float4" => ["Float32"], "double precision" => ["Float64"], "float8" => ["Float64"], "numeric" => ["Float64", "PG::Numeric", "BigDecimal"], "decimal" => ["Float64", "PG::Numeric", "BigDecimal"], "text" => ["String"], "varchar" => ["String"], "character varying" => ["String"], "char" => ["String"], "character" => ["String"], "name" => ["String"], "boolean" => ["Bool"], "bool" => ["Bool"], "timestamp" => ["Time"], "timestamp without time zone" => ["Time"], "timestamp with time zone" => ["Time"], "timestamptz" => ["Time"], "date" => ["Time"], "time" => ["Time"], "time without time zone" => ["Time"], "time with time zone" => ["Time"], "timetz" => ["Time"], "uuid" => ["UUID"], "json" => ["JSON::Any"], "jsonb" => ["JSON::Any"], "bytea" => ["Bytes", "Slice(UInt8)"], "text[]" => ["Array(String)"], "integer[]" => ["Array(Int32)"], "bigint[]" => ["Array(Int64)"], "boolean[]" => ["Array(Bool)"]}
PostgreSQL type mappings to Crystal types Used to check if model types match database types
Class methods
Validate a model class against the database schema