These are chat archives for oncue/knobs

29th
May 2016
stliang
@stliang
May 29 2016 17:39
I am hoping to use knobs to read secrets set in environment variables such as "export h2username=sa" with SysPropsResource. Apparently system properties from SysPropsResource don't include environment variables. Is this true?
val xat = for {
cfg <- knobs.loadImmutable(Required(SysPropsResource(Prefix("h2"))) :: Nil)
usr = cfg.requireString
pwd = cfg.requireString
} yield DriverManagerTransactorTask
having trouble pasting code above :O(
stliang
@stliang
May 29 2016 17:46
''' val xat = for {
cfg <- knobs.loadImmutable(Required(SysPropsResource(Prefix("h2"))) :: Nil)
usr = cfg.requireString
pwd = cfg.requireString
} yield DriverManagerTransactorTask'''
val xat = for { cfg <- knobs.loadImmutable(Required(SysPropsResource(Prefix("h2"))) :: Nil) usr = cfg.require[String]("h2username") pwd = cfg.require[String]("h2password") } yield DriverManagerTransactor[Task]("org.h2.Driver", "jdbc:h2:mem:todo;DB_CLOSE_DELAY=-1", usr, pwd)