Adds limit function to database class
Better database type handling