-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: add SECURITY DEFINER to the postgresql Function #59
Comments
|
I'd appreciate it if you could test the PR out ahead of my merging it, to make sure it does what you're anticipating it do. |
Thank you. Everything generated correctly.
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute(
"""CREATE FUNCTION refresh_my_view() RETURNS void SECURITY DEFINER LANGUAGE plpgsql AS $$
BEGIN
REFRESH MATERIALIZED VIEW my_view WITH DATA;
END
$$;"""
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute("""DROP FUNCTION refresh_my_view();""")
# ### end Alembic commands ###
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute(
"""CREATE OR REPLACE FUNCTION refresh_my_view() RETURNS void SECURITY DEFINER LANGUAGE plpgsql AS $$
BEGIN
REFRESH MATERIALIZED VIEW my_view WITH DATA;
END
$$;"""
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.execute(
"""CREATE OR REPLACE FUNCTION refresh_my_view() RETURNS void LANGUAGE plpgsql AS $$
BEGIN
REFRESH MATERIALIZED VIEW my_view WITH DATA;
END
$$;"""
)
# ### end Alembic commands ###
|
It would be nice to have the possibility to provide the
SECURITY DEFINER
directive as a field to the sqlalchemy_declarative_extensions.dialects.postgresql.Function, along withlanguage
orreturns
fields.Because right now, we have to add it manually in our migration scripts.
The text was updated successfully, but these errors were encountered: