module Prostore::Steps::Codec

Overview

Serialize/deserialize Steps::Kind::* values to and from JSON for persistence in prostore_migration_step.params (ADR-0009 invariant 2: plan-at-start, never recompute on resume).

Each step round-trips losslessly: the encoded form contains every primitive needed to re-execute, so the deserialized step yields identical DDL on retry. No Symbols are ever stored — everything is String-keyed JSON, which is why Schema::Field.name and the column arrays on indexes/FKs are typed as String at the schema model level.

Extended Modules

Defined in:

prostore/steps/codec.cr

Instance Method Summary

Instance Method Detail

def decode(kind : String, params_json : String) : Kind::Any #

[View source]
def decode_definition(j : JSON::Any) : Schema::Definition #

[View source]
def decode_field(j : JSON::Any) : Schema::Field #

[View source]
def decode_foreign_key(j : JSON::Any) : Schema::ForeignKey #

[View source]
def decode_index(j : JSON::Any) : Schema::Index #

[View source]
def encode(step : Kind::Any) : NamedTuple(kind: String, params: String) #

[View source]
def encode_definition(d : Schema::Definition) : String #

[View source]
def encode_field(f : Schema::Field) #

[View source]
def encode_foreign_key(fk : Schema::ForeignKey) #

[View source]
def encode_index(i : Schema::Index) #

[View source]