Generally Typesetter will not restrict you in using databases (or any other things you can do with PHP). It's merely a question of implementation.
For simple testing you could add your code directly to template.php. In the end, a plugin using hooks (like Gadget, Special Page, Admin Page or even Section Types) will most likely the better solution.
Find out more about our Provider Spotlight