move "mark all read" SQL query as function to libertree-db