Code to manage the trailer DB