Upgrading MySQL adapter to use templates.