Using Osmosis with a database