Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewing a grails schema while it runs in memory?

I want to view a grails schema for the default hsqldb in-memory database, but when I connect to the in-memory databse with SquirrelSQL or DbVisualizer as userid: sa, password: (nothing), I only see two schemas:

INFORMATION_SCHEMA
PUBLIC

And neither contains my Domain tables. What's going on?

like image 460
Stefan Kendall Avatar asked Mar 02 '11 15:03

Stefan Kendall


3 Answers

You need to set the hsqldb database to file, and set shutdown to true, as outlined here.

like image 127
Stefan Kendall Avatar answered Oct 24 '22 01:10

Stefan Kendall


If you want to access the in-memory database, there's a writeup on how to do that here: http://act.ualise.com/blogs/continuous-innovation/2009/07/viewing-grails-in-memory-hsqldb/

There's also a new plugin that gives you access to a web-based database console that can access any database that you have a JDBC driver for, including the in-memory hsql db. The plugin docs are at http://grails.org/plugin/dbconsole and you install it the usual way, i.e. grails install-plugin dbconsole. Unfortunately the plugin has an artificial restriction to Grails 1.3.6+, so if you're using an older version of Grails you can use the approach from the blog post that inspired the plugin, http://burtbeckwith.com/blog/?p=446

To use the database console, select "Generic HSQLDB" from the settings dropdown and change the values to match what's in DataSource.groovy. This will probably just require changing the url to jdbc:hsqldb:mem:devDB

like image 38
Burt Beckwith Avatar answered Oct 24 '22 02:10

Burt Beckwith


You need to set up a shared hsql database: Creating a shared HSQLDB database

edit: There is NO way to expose in-memory hsqldb. Either create a Server or WebServer or use file URL.

like image 44
Victor Sergienko Avatar answered Oct 24 '22 01:10

Victor Sergienko