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

feat: Add table_name and store_resource_name? DSL options. #110

Merged
merged 3 commits into from
Sep 15, 2024

Conversation

jimsynz
Copy link
Contributor

@jimsynz jimsynz commented Sep 12, 2024

feat: Add table_name DSL option.

When using a SQL-based data layer, allow the user to explicitly set the table name for version storage.

feat: Add store_resource_name? DSL option.

Adds a version_resource_name attribute to the version resource which stores the name of the resource that is being changed.

@zachdaniel
Copy link
Contributor

I'd rather have some kind of "version identifier" than the module name itself I think. Regardless, if storing that, we should also add a base filter on the version resource that it is what you're saying. That way you don't get versions from other resources.

@jimsynz
Copy link
Contributor Author

jimsynz commented Sep 12, 2024

I'd rather have some kind of "version identifier" than the module name itself I think.

What if we store the resource's short_name rather than the module name?

Regardless, if storing that, we should also add a base filter on the version resource that it is what you're saying. That way you don't get versions from other resources.

Good idea.

@zachdaniel
Copy link
Contributor

The only issue with short name is that, unlike the module name it's not guaranteed to be unique, and if the module name changed, the default short name changes as well. If we use the resource name, changing the module name could require a migration of the largest tables in an app.

@jimsynz
Copy link
Contributor Author

jimsynz commented Sep 12, 2024

Okay, so we let them specify the resource name in this instance and default it to short_name

@jimsynz jimsynz force-pushed the feat/add-table-name-resource-name branch from 08ad271 to 7e1be8e Compare September 13, 2024 02:07
Adds a `version_resource_identifier` attribute to the version resource which stores an identifer for the resource being versioned.
When using a SQL-based data layer, allow the user to explicitly set the table name for version storage.
@jimsynz jimsynz force-pushed the feat/add-table-name-resource-name branch from 7e1be8e to de9771d Compare September 13, 2024 02:16
@jimsynz jimsynz merged commit 1f5877f into main Sep 15, 2024
16 checks passed
@jimsynz jimsynz deleted the feat/add-table-name-resource-name branch September 15, 2024 22:13
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