Skip to content

Commit

Permalink
fix: create hasura role if not exist (for dev)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Nov 26, 2024
1 parent cafbdfd commit 623364c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ferry/database/sync_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def sync_db(tables: dict[str, pd.DataFrame], database_connect_string: str):
# TODO: we should set up some mechanism to automatically grant
# privileges... The default on the schema is not enough.
print("\nGranting privileges to hasura...")
db_session.execute(text("CREATE ROLE IF NOT EXISTS hasura;"))
db_session.execute(text("GRANT SELECT ON ALL TABLES IN SCHEMA public TO hasura;"))
db_session.execute(text("GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO hasura;"))
print("\033[F", end="")
Expand Down

0 comments on commit 623364c

Please sign in to comment.