duct-framework / duct

Server-side application framework for Clojure
MIT License
1.13k stars 51 forks source link

Exception running from template combination +api +ataraxy +sqlite +example #81

Closed alan-saar closed 6 years ago

alan-saar commented 6 years ago

+site +ataraxy +sqlite +example works

when I try with +api the I got the following

steps:

$ lein new duct project +api +ataraxy +sqlite +example
$ cd project
$ lein duct setup
$ lein run
Exception in thread "main" clojure.lang.ExceptionInfo: Error on key :duct.database.sql/hikaricp when building system (...)
Caused by: java.lang.IllegalArgumentException: Invalid configuration options: (:adapter)
alan-saar commented 6 years ago

I think this is solved in duct beta. The message is so much better. dev run from the box. Prod gives a nice error message.

$ lein new duct-beta project +api +ataraxy +sqlite +example
$ cd project
$ lein duct setup
$ lein run
Error on key :duct.database.sql/hikaricp when building system (...)
Caused by: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required.
weavejester commented 6 years ago

I believe lein run requires a DATABASE_URL environment variable to be set, or for the database URL to be specified in the configuration. In development, there are default values. As I recall, the idea was that it's better to be explicit in production, and permissive in development.

The beta version should be turned into a release soon, once I get a bit of time to finish updating the documentation.