Adapt code for muliple database providers