views:

603

answers:

3
+1  Q: 

Grails + sqlite

Is there any way to use SQLite as a database storage for my Grails app?

If I use a SQLite JDBC driver (http://www.zentus.com/sqlitejdbc/), my app fails to start with "Could not determine Hibernate dialect for database name [SQLite]"

The only workaround I found was http://d.hatena.ne.jp/torutk/20090711/p3 (it's in Japanese, have it google translated if you want), but it does not make any help.

Or, is the idea of using SQLite for web apps so terrible that nobody uses it?:)

EDIT: Yes, I know, the default Grails HSQLDB support works just fine, but my web app is a part of a bigger system which uses solely SQLite, so we would prefer end up supporting only one database instead of both HSQLDB and SQLite.

A: 

If you want to use a file based db, grails comes with built in access to HSQLDB, which can be easily configured to be in-memory or file based. I was initially going to try to use sqlite, but went with HSQLDB approach because of grail's default support for it, and I have not run into any problems so far.

nstehr
Sadly, other part of our application uses SQLite, so we would prefer using SQLite over HSQL to avoid supporting two databases at once
Sam
+1  A: 

You can write custom dialect. For SQLite it should be simple.

Refer Hibernate SqLiteDialect

lud0h
+2  A: 

I haven't used it but you might want to try using the SQLiteDialect from the hibernate-sqlite project. They even show you a sample connection String in their readme.txt

There are some comments in this thread that might help you gain some context.

Colin Harrington