Fork me on GitHub
#duct
<
2018-08-15
>
psdp12:08:28

@myguidingstar Thanks! I've solved that problem now by putting args from (-main) in a global var, maybe not a good idea but at least it works now. I have another issue still when using the CLI handler to connect to a database to do some work, a lot of SQL statements would be printed out in the console, this is totally fine when running the web app in production, but I want basically no console output from logs when accessing from my CLI application. I've tried setting a different database connection with a different logger:

[:duct.logger.timbre/spit :my-app.logger.cli/spit] {:fname "logs/cli.log"}
 [:duct.logger/timbre :m-app.logger/cli]            {:appenders {:duct.logger.timbre/spit #ig/ref :my-app.logger.cli/spit}}

[:duct.database.sql/hikaricp :my-app.database/cli] {:jdbc-url                  #duct/env "DB_URL"
                                                    :logger                    #ig/ref :m-app.logger/cli
                                                    :zero-date-time-behavior   "convertToNull"
                                                    :use-unicode               true
                                                    :character-encoding        "UTF-8"
                                                    :use-legacy-date-time-code false}
Turned out that it would be changing the default logger behavior too. Not sure why.

scaturr15:08:06

This might be a silly question, but how would I get a configured boundary at the repl?

scaturr15:08:15

Say the db boundary for instance

dadair17:08:34

@scaturr you should be able to instantiate the record (def db (duct.database.sql/->Boundary <spec>)), and then use it with whatever boundary protocol you’ve defined

dadair17:08:21

assuming you’ve extended the protocol for the duct.database.sql.Boundary type

scaturr17:08:27

I was able to use the following:

(defn db []
  (-> system (ig/find-derived-1 :duct.database/sql) val))

scaturr17:08:37

In the dev namespace

scaturr17:08:48

Thank you for the response 🙂