Virtual / Volatile DBIx Class Row Columns
Is it possible to add columns to a DBIx :: Class :: Row object that are virtual since they are not stored in the database? I'm looking for functionality like Rose :: DB :: Object provides via its non-persistent columns http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Metadata.pm#nonpersistent_columns
+3
source to share
2 answers
I just needed to watch it again as I need it. You may already have a solution, but for others who come here: https://metacpan.org/module/DBIx::Class::Manual::FAQ#Misc
Basically use Moose and create an attribute, or add something like this to your schema:
__PACKAGE__->mk_group_accessors('simple' => qw/non_column_data/); # must use simple group
+2
source to share