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

SQLite view introspection, flavours #3756

Merged
merged 1 commit into from
Mar 3, 2023
Merged

SQLite view introspection, flavours #3756

merged 1 commit into from
Mar 3, 2023

Conversation

pimeys
Copy link
Contributor

@pimeys pimeys commented Feb 28, 2023

Gotchas:

  • Column arity is always optional for views, so we do the same trick in re-intro as we do with PostgreSQL.
  • No default values in views.

Closes: prisma/prisma#17416

@pimeys pimeys added this to the 4.12.0 milestone Feb 28, 2023
@pimeys pimeys requested a review from a team as a code owner February 28, 2023 19:27
Copy link
Contributor

@tomhoule tomhoule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome that we introduce flavours in introspection too, now. We can even use the same SqlFlavour from sql-migration-connector once we merge introspection-connector and migration-connector.


let file = database_url.trim_start_matches("file:");
std::fs::remove_file(&file).ok();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's sqlite_test_file() in test_setup that does the sqlite file truncation too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'm already using this through sqlite_test_url. It somehow uses the same file in the subsequent runs... Therefore removing it here.

&& self.context.sql_family.is_postgres();

if keep_previous_arity {
if self.context.flavour.keep_previous_scalar_field_arity(self.next) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pimeys pimeys merged commit 69f1ad6 into main Mar 3, 2023
@pimeys pimeys deleted the intro/sqlite_view_intro branch March 3, 2023 09:21
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

Successfully merging this pull request may close these issues.

Introspection of SQLite views
2 participants