pgollangi / FireQL

Interactive CLI and Go library to query Google Firestore database using SQL syntax.
https://pgollangi.github.io/FireQL/
MIT License
31 stars 1 forks source link

panic when service account or current `gcloud` default account credentials don't have access to Firestore #4

Closed pgollangi closed 1 year ago

pgollangi commented 1 year ago

FireQL exiting with panic error when currently authenticating credentials don't have access to Firestore and/or project

goroutine 1 [running]:
cloud.google.com/go/firestore.(*DocumentSnapshot).Data(0x1400038be60?)
        /Users/p.gollangi/go/pkg/mod/cloud.google.com/go/firestore@v1.9.0/document.go:69 +0x18
github.com/pgollangi/fireql/pkg/select.(*SelectStatement).readResults(0x1400038bdd0?, 0x14000148690?, {0x1400012ab88, 0x1, 0x1})
        /Users/p.gollangi/dev/pgollangi-github/fireql/pkg/select/select.go:101 +0x198
github.com/pgollangi/fireql/pkg/select.(*SelectStatement).Execute(0x1400035fee0)
        /Users/p.gollangi/dev/pgollangi-github/fireql/pkg/select/select.go:77 +0x364
github.com/pgollangi/fireql.(*FireQL).Execute(0x1400012a920, {0x102b08c1f, 0x1f})
        /Users/p.gollangi/dev/pgollangi-github/fireql/fireql.go:42 +0x1bc
main.main()
        /Users/p.gollangi/dev/pgollangi-github/fireql/cmd/main.go:74 +0x48

Expected behavior It should handle error and log message instead.

ENV