Problem connecting to a Postgres DB

2021-06-19 Thread mronetwo
Oh, you're correct about the two instance of `db`. I can't get rid of the `var db:DbConn` because of the scoping. `let db` is valid only in the `try` block. I've removed the `let`. That also made me realize that `defer` is called at the end of the `try` block... I've also removed `defer: db.clos

Problem connecting to a Postgres DB

2021-06-19 Thread mronetwo
Hello, I'm having problems interacting with a Postgres DB with Nim proc handleDbSync(dbParams: tuple[dbAddr: string, user: string, password: string, db: string]) {.thread.} = var logger = newConsoleLogger() var db: DbConn logger.log(lvlInfo, "DB: " & dbParams.user &

Writing a string into a source file compile time

2020-12-03 Thread mronetwo
and @pietroppeter exactly what I needed. Thank you so much.

Writing a string into a source file compile time

2020-12-03 Thread mronetwo
Hello, I'd like to build a binary with a `staticRead` but I'd like to modify the path of the file to be read compile time. I have my config.nims task build_that_binary, "...": let sourceFile = paramStr(paramCount() -1 ) let firmwareFile = paramStr(paramCount()) #