muuki88 / sbt-slick

Slick Code Generation Plugin
Apache License 2.0
12 stars 4 forks source link

Updated to support Postgres. #4

Closed drdozer closed 8 years ago

drdozer commented 8 years ago

Added initial support for Postgres. See #3.

drdozer commented 8 years ago

The issue is that postgres requires credentials as extra arguments but mysql encodes them in the URL. How about this? Make the url key into Option[String]. Then have a key that holds a binary flag - postgrestyle/mysqlstyle. Use the binary flag to switch the url-generating and arguments behaviour. That way a person can't do it too badly wrong manually.

drdozer commented 8 years ago

If the port is dynamically reconfigured, then it has to be a TaskKey. For example, I'm dynamically assigning the port because it is provided by a randomy bound port from a docker container.

drdozer commented 8 years ago

The postgres plugin works now. I'm going to refactor to get rid of the slickArguments key as you suggest.

drdozer commented 8 years ago

I'm considering re-writing the URL bit of the plugin to either take a url string, or if this is None, generate it from keys. So slickUrl becomes Option[String], and if it is None, a plugin-specific function kicks in to generate a URL using all the keys.

drdozer commented 8 years ago

OK, the current head works and seems OK to me. No need at this time to re-visit the URL issue I think.

muuki88 commented 8 years ago

LGTM

muuki88 commented 8 years ago

released with 0.5