You can't avoid that when using a framework, since the main differentiation between a library and framework is inversion of control. Writing some kind of abstraction on top of the framework is a pointless endeavor since at the end of the day, all of your code will be structured in a way that adheres to the contract defined by that framework.
Databases don't dictate the structure of your entire application like a framework does, so that comparison is not useful.
Databases don't dictate the structure of your entire application like a framework does, so that comparison is not useful.