flashmob / go-guerrilla

Mini SMTP server written in golang
MIT License
2.76k stars 361 forks source link

Cannot change SQL backend to Postgres #144

Open lllama opened 5 years ago

lllama commented 5 years ago

I've been trying to use the new backends functionality to change from MySQL to Postgres.

I get the following error (or variant depending on what I change sql_driver to:

error while initializing the backend: sql: unknown driver \"lib/pq\" (forgotten import?)

Would it be possible to get an example config, or some idea of how to make sure the correct driver is loaded? (perhaps @danielwhite might have an idea...)

Many thanks!

lllama commented 5 years ago

Looks like the driver string needs to be postgres.

Note that there seems to be other issues with using postgres, as the SQL statements use backticks, which postgres does not like.

flashmob commented 5 years ago

Thanks for the update. You're welcome to document this if you get it to work - would be happy to add your contribution to the wiki.