Replies: 3 comments 2 replies
-
Thanks for the Django reference, it helps thinking about a solution! For this case, we want to run a raw SQL statement, a moment after the connection has been created. Example:
You can experiment with the various ways to run a raw statement here: https://www.sea-ql.org/SeaORM/docs/basic-crud/raw-sql/#use-raw-query--execute-interface |
Beta Was this translation helpful? Give feedback.
-
For the migrator part, note that migrator also has a trait and functions you can override, the default in your project may look like this, in
You can override |
Beta Was this translation helpful? Give feedback.
-
@thoward27 did you manage to get it resolved? |
Beta Was this translation helpful? Give feedback.
-
Hey there folks!
I'm working on a small Loco project and am using credentials generated by vault to communicate with my database.
The issue I have is that all of the objects created by the migrator are owned by this temporary credential set, instead of the inherited role.
With Django, this problem is solved by https://github.com/jdelic/django-postgresql-setrole
I'm hoping to figure out how to do something similar with Loco.
My ideal outcome would be a setting that allows a user to specify a role. When the migrator runs, it would pick up this role and execute
SET ROLE {role}
.This doesn't look possible in Loco right now. Is there a path forward? I can't figure out how to even plumb the config object through to the migrator from my project.
Beta Was this translation helpful? Give feedback.
All reactions