Many people go through a phase of writing their own Object Relational Mapping class. I did.
Then I discovered Class::DBI and threw away my own ORM code.
Then I discovered DBIx::Class and threw away all my code that used Class::DBI.
That painful exercise makes me appreciate DBIx::Class all the more!