luminus-framework / luminus

documentation site for Luminus framework
http://www.luminusweb.net/
629 stars 121 forks source link

Error occurred when connecting to sqlite #120

Closed boathit closed 8 years ago

boathit commented 8 years ago

When I followed the official tutorial but changed the db engine from h2 to sqlite like lein new luminus guestbook +sqlite and run lein run migrate I got

[ERROR][migratus.database] Error creating DB connection for {:connection-uri "jdbc:h2:./guestbook.db.mv.db"} java.sql.SQLException: No suitable driver found for jdbc:h2:./guestbook.db.mv.db ...

I use Leiningen 2.6.1 on Java 1.8.0_25 Java HotSpot(TM) 64-Bit Server VM on Mac OSX 10.11.3

yogthos commented 8 years ago

You have to change your connection URL to something like "jdbc:sqlite:guestbook_dev.db" for the sqlite database. It's found in profiles.clj by default.

boathit commented 8 years ago

Thank you @yogthos, I think I should find the source file where {:connection-uri "jdbc:h2:./guestbook.db.mv.db"} appears in, but I failed to locate it.

yogthos commented 8 years ago

Ah so that part's a bit confusing. The migrations library calls the variable :connection-uri, but the project looks for :conneciton-url. So, the variable is set here, but comes from here when you run lein run migrate.

The easiest way to find where it might be defined is by running grep -iIR "jdbc:h2" * in the project folder from the terminal.

boathit commented 8 years ago

Thank you so much @yogthos. Problem is perfectly solved.

yogthos commented 8 years ago

glad to hear it :)