Plugins You can find out about all the publicly available Grails plugins.

DbUtil Plugin

  • Authors: null
3 votes
compile "org.grails.plugins:db-util:0.4"




DbUtil Plugin


This plugin exists to allow a developer to quickly access the database for a running Grails application. Some embedded dbs, like derby only allow access to the db from within the JVM that has launched the db. Others such as the in-memory HSQL may not provide an decent tool to quickly see what the database looks like for a newly created Grails app. To get around these limitations I wrote this small plugin (1 controller & 3 gsps) that can be used to admin the db within a Grails app as it is running. Simply install the plugin into your existing app, run your app and go to http://server:port/appName/dbUtil to access the database screens. Check out the Screenshots tab to see exactly what the plugin provides.


grails install-plugin db-util


There are three actions with the following urls described below…
  • /$appname$/dbUtil/info - Shows info about the db (tables/columns/column type, etc)
  • /$appname$/dbUtil/data - Outputs all the actual data alphabetically by table
  • /$appname$/dbUtil/sql - Allows free-form select/update/delete commands
Note: I've included commons-dbutils-1.1 from apache in the lib directory.

IMPORTANT: You will definitely want to protect this controller's url from unauthorized access since the sql action can be used to do just about anything.


  • DbutilController.groovy
  • data.gsp
  • info.gsp
  • sql.gsp

Next Steps:

  • With the "configuration by environment" feature of Grails 1.1 I hope to add the ability to control whether this plugin is installed into a production app. Because it is a security hole, by default I plan to disable the plugin in production.

Version Notes:

  • 0.4 - Upgraded to Grail 1.1 and fixed related bugs
  • 0.3 - 1.0.x