Skip to content

Commit c16f65f

Browse files
committed
Use deprecated track_table
1 parent 777b31d commit c16f65f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hasura/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ func (api *API) ReplaceMetadata(data *Metadata) error {
138138
}
139139

140140
// TrackTable -
141-
func (api *API) TrackTable(source, name string) error {
141+
func (api *API) TrackTable(schema, name string) error {
142142
req := request{
143-
Type: "pg_track_table",
143+
Type: "track_table",
144144
Args: map[string]string{
145-
"source": source,
146-
"table": name,
145+
"schema": schema,
146+
"name": name,
147147
},
148148
}
149-
return api.post("/v1/metadata", nil, req, nil)
149+
return api.post("/v1/query", nil, req, nil)
150150
}
151151

152152
// CreateSelectPermissions - A select permission is used to restrict access to only the specified columns and rows.

hasura/hasura.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func Create(hasura config.Hasura, cfg config.Database, views []string, models ..
7474

7575
log.Info("Tracking views...")
7676
for i := range views {
77-
if err := api.TrackTable(cfg.Database, views[i]); err != nil {
77+
if err := api.TrackTable("public", views[i]); err != nil {
7878
if !strings.Contains(err.Error(), "view/table already tracked") {
7979
return err
8080
}

0 commit comments

Comments
 (0)