[RC1] sql plugin

@mhlavac

The first step towards mariadb branch. I'm still not convinced enough to propose to use MariaDB in the main branch.