dbnet-io / dbnet

dbNet is a web-based database client using Go as a backend, and React as front-end
https://docs.dbnet.io
GNU Affero General Public License v3.0
15 stars 1 forks source link

Cant connect to Sqlite DB via web gui. #8

Closed gedw99 closed 1 year ago

gedw99 commented 1 year ago

I installed using brew install dbnet-io/dbnet/dbnet

/usr/bin/sqlite3 is insalled via brew also.

I have a sqlite db setup with a single table with data and exposed as ENV:

 sqlite:////Users/apple/workspace/go/src/github.com/gedw99/x-platform/data/flarco/.data/sqlite/test.db
dbnet conns list
+-----------+-------------+--------------+
| CONN NAME | CONN TYPE   | SOURCE       |
+-----------+-------------+--------------+
| SQLITE    | DB - SQLite | env variable |
dbnet serve
2023-07-06 13:05:46 INF Serving @ http://0.0.0.0:5987
{"time":"2023-07-06T13:05:46.257864+02:00","level":"INFO","prefix":"echo","message":"Echo (v5.0.0-alpha). High performance, minimalist Go web framework https://echo.labstack.com"}
{"time":"2023-07-06T13:05:46.257901+02:00","level":"INFO","prefix":"echo","message":"http(s) server started on [::]:5987"}
....

2023-07-06 13:05:50 ERR  error="invalid uri authority: Users"
{"time":"2023-07-06T13:05:50.501021+02:00","level":"INFO","id":"","remote_ip":"::1","host":"localhost:5987","method":"GET","uri":"/sqlite/.databases?&","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36","status":500,"error":"code=500, message=map[error:could not get databases [~ could not connect to database\ninvalid uri authority: Users]]","latency":55617946,"latency_human":"55.617946ms","bytes_in":0,"bytes_out":0}

The web gui flashes:


Error: could not get databases [~ could not connect to database invalid uri authority: Users]
gedw99 commented 1 year ago

more info

dbnet conns list
+-----------+-------------+--------------+
| CONN NAME | CONN TYPE   | SOURCE       |
+-----------+-------------+--------------+
| SQLITE    | DB - SQLite | env variable |
+-----------+-------------+--------------+

dbnet conns test SQLITE
fatal:
~ 
~ could not test SQLITE
~ could not connect to SQLITE
~ could not connect to database
invalid uri authority: Users
flarco commented 1 year ago

Hi, just seeing this.

sqlite:////Users/apple/workspace/go/src/github.com/gedw99/x-platform/data/flarco/.data/sqlite/test.db appears to have an extra slash. sqlite://// should be sqlite:///

can you try sqlite:///Users/apple/workspace/go/src/github.com/gedw99/x-platform/data/flarco/.data/sqlite/test.db?

gedw99 commented 1 year ago

Thanks . Dumb mistake on my part :)

gedw99 commented 1 year ago

works

dbnet conns list
+-----------+-------------+--------------+
| CONN NAME | CONN TYPE   | SOURCE       |
+-----------+-------------+--------------+
| SQLITE    | DB - SQLite | env variable |
+-----------+-------------+--------------+

dbnet serve
2023-07-10 15:53:36 INF Serving @ http://0.0.0.0:5987
Screenshot 2023-07-10 at 15 53 51