Skip to content

trait column inflate deflate

Fernando Correa de Oliveira edited this page Aug 20, 2018 · 1 revision
sub inflate(Str $varchar     --> CustomType) { CustomType.new: $varchar.split: "," }
sub deflate(CustomType $data --> Str       ) { CustomType.Str }

model Bla {
   has CustomType $.bla is column{ :type<varchar>, :&inflate, :&deflate }
}
Clone this wiki locally