This could be moved somewhere so it is a service available for all database types.