Switch to admin role first thing in camper-weather
The authenticator user has no access to the weather_forecast relation.
This commit is contained in:
parent
5ccd796e1b
commit
9b938dad97
|
@ -43,6 +43,10 @@ func main() {
|
|||
}
|
||||
defer conn.Release()
|
||||
|
||||
if _, err := conn.Exec(context.Background(), "set role to admin"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
var stationURL string
|
||||
if err := conn.QueryRow(context.Background(), `
|
||||
select station_uri
|
||||
|
@ -63,10 +67,6 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if _, err := conn.Exec(context.Background(), "set role to admin"); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
for _, forecast := range result.Forecasts {
|
||||
if _, err := db.Exec(context.Background(), `
|
||||
update weather_forecast
|
||||
|
|
Loading…
Reference in New Issue