Understand how to passL path to the libpq.dylib so that the db_connector can find it when using the embedded Postgres.
For now one of the best solution is to use push/pop dynlib pragmas around the code that uses the db_connector to ensure it can find the correct version of libpq.
|
{.push dynlib: currentSourcePath().parentDir / "greskewelbox" / "bin" / "16.9.0" / "darwin" / "lib" / "libpq.dylib".} |
|
let db = open("localhost", "postgres", "postgres", "postgres") |
|
db.exec(sql"""CREATE TABLE myTable (id integer, name varchar(50) not null)""") |
|
db.exec(sql"""INSERT INTO myTable (id, name) VALUES (1, 'Alice')""") |
|
for row in db.getAllRows(sql"""SELECT * FROM myTable"""): |
|
echo "Row: ", row |
|
{.pop.} |
Understand how to
passLpath to thelibpq.dylibso that thedb_connectorcan find it when using the embedded Postgres.For now one of the best solution is to use
push/popdynlib pragmas around the code that uses thedb_connectorto ensure it can find the correct version oflibpq.greskewel/tests/test2.nim
Lines 31 to 37 in b5ef2af