Hi guys, I'm trying to figure out how to use my postgres lib in vibe.d routes. The problem is vibe.d uses threads and that causes null pointer errors since it's sharing one pg connection over multiple threads.

Is there a way to assign a connection to each thread? Not sure how the threading works in vibe.d but my problem would be solved if I could pre-connect to a number of connections on startup and distribute them among threads. Say have an array of my PostgresDB. Maybe this won't work, however it seems like the best solution I can think up.

Could anyone help me figure out if this is possible?