Skip to content
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

View support #135

Open
bplunkett-stripe opened this issue May 29, 2024 · 3 comments
Open

View support #135

bplunkett-stripe opened this issue May 29, 2024 · 3 comments

Comments

@bplunkett-stripe
Copy link
Collaborator

bplunkett-stripe commented May 29, 2024

Add support for views. A fully-supported view feature will be blocked until we can order on individual columns adds/drops.

@Scorg
Copy link

Scorg commented Sep 17, 2024

Hi! Could you elaborate a bit on this? I thought the support was just a matter of issuing create or replace with the new definition.

@bplunkett-stripe
Copy link
Collaborator Author

Think of it like this. You have an existing view foobar that references columns fizzbuzz.color and fizzbuzz.value.

Your new schema has foobar but it references a new column fizzbuzz.new_value and it no longer references fizzbuzz.value, which is being dropped.

The SQL statement now needs to be ordered such that. that view is created or replace BEFORE the old value column is deleted (otherwise the old column drop will fail) but AFTER the column fizzbuzz.value is added.

Views can actually have a pretty complicated web of dependencies depending on how "advanced" you want your schema diffing support to go.

@Scorg
Copy link

Scorg commented Sep 20, 2024

Well, this made me read the docs, and this is awful. Please excuse my initial ignorance, I got too spoiled by Oracle, where it just recompiles and invalidates the dependencies, so you can update objects in any order and just recompile invalid ones afterwards.

May be it would be enough at first to just detect and drop dependent views before table/view changes and recreate them later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants