-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: database is closed #3
Comments
I have not tried Postgres, I would check your config info. |
@goodforever I double-checked and I was able to get Postgres working. Changed server.go to have
Instead of
Make sure that you change any credentials and database accordingly. Also, I believe you will have to create the database prior to starting the server. Unlike Sqlite, Postgres can have multiple databases under the same connection (sqlite would require multiple files as far as I know, maybe I am wrong), which means the driver needs the database to exist to connect to it. If you have done all that I am not sure why it wouldn't be working but like I said I verifed it to working. FYI: I used docker for both the database and database management tools
When the database was not created I did get an error on startup that was different then yours
|
I use postgresql server ,When I go run server.go ,I got
(sql: database is closed)
[2018-07-20 11:36:04]
(sql: database is closed)
[2018-07-20 11:36:04]
(sql: database is closed)
[2018-07-20 11:36:04]
(sql: database is closed)
[2018-07-20 11:36:04]
[negroni] listening on :3000
The text was updated successfully, but these errors were encountered: