wundergraph/wunderbase

Server can't create db.sqlite file if data folder does not exist

XuluWarrior opened this issue · 3 comments

If installed and started as instructed in the README, the server will error with the following.

2022/10/26 00:27:21 Migration failed:
{
  "jsonrpc": "2.0",
  "error": {
    "code": 4466,
    "message": "An error happened. Check the data field for details.",
    "data": {
      "is_panic": false,
      "message": "unable to open database file: ./data/db.sqlite\n",
      "meta": {
        "full_error": ""
      }
    }
  }
}

This is easily rectifiable by manually creating a data folder but I would expect the server to do this automatically on startup

Sounds reasonable.
We need to extract the sqlite file path and build the dir tree (https://pkg.go.dev/os#MkdirAll).
Are you up for a PR?

Are you up for a PR?

Not any time soon. I haven't done any Go development and I don't have the time to pick it up right now.

Got it. It doesn't seem to be a priority then. If things change, please re open or just submit a PR. Thanks.