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

Add some view utils #3553

Merged
merged 7 commits into from
Dec 4, 2024
Merged

Conversation

L-Mario564
Copy link
Collaborator

@L-Mario564 L-Mario564 commented Nov 14, 2024

Addresses #2610 & #3392.
#2153 can be closed if docs are added for these additions.

This PR adds some utilities that can be used with views + Bugfix.

  • Added getViewSelectedFields. Similar to getTableColumns but for views.
  • Fixed a bug where nested properties were disallowed within views and specifying a table instead of a column resulted in never instead of mapping it to that table's columns.
  • Added $inferSelect method to views.
  • Added InferSelectViewModel. Similar to InferSelectModel but for views. Not sure if we want the latter to be used for both views and tables so I created a separate type to avoid adding more responsability to the latter type.
  • Added isView util function.

@AndriiSherman AndriiSherman merged commit 3f3eb73 into drizzle-team:beta Dec 4, 2024
7 checks passed
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.

2 participants