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 an option database_type #374

Closed
wants to merge 1 commit into from
Closed

Add an option database_type #374

wants to merge 1 commit into from

Conversation

n-rodriguez
Copy link
Contributor

Problem: When using numeric_ordering: true, closure_tree tries to find out the type of database during the initialization process. This can be problematic, for example when doing rails db:create, in which case there is no database, yet. Another scenario is rails asssets:prcompile in a Docker container that is being made for production, but it doesn't have access to the production database yet, because it isn't rolled out, yet.

Solution: I have added an option to specify the database_type manually. This option is only used then numeric_ordering is set to true

Problem: When using `numeric_ordering: true`, closure_tree tries to find out the type of database during the initialization process. This can be problematic, for example when doing `rails db:create`, in which case there is no database, yet. Another scenario is `rails asssets:prcompile` in a Docker container that is being made for production, but it doesn't have access to the production database yet, because it isn't rolled out, yet.

Solution: I have added an option to specify the database_type manually. This option is *only* used then numeric_ordering is set to `true`
@n-rodriguez
Copy link
Contributor Author

This PR is a rebase on master branch of #338.

It closes #344 and #338

@n-rodriguez
Copy link
Contributor Author

On my side everything is green : https://github.com/n-rodriguez/closure_tree/actions/runs/491731739

ping @seuros

@n-rodriguez
Copy link
Contributor Author

well.... there might be an other way of doing it by using load_schema!

I'll see what I can do

@timdown
Copy link

timdown commented Jan 17, 2021

Is there any chance this could be used to add in database-specific queries? For example, a MySQL-specific query for faster hierarchy deletion (see #343)

@kbrock
Copy link
Contributor

kbrock commented Mar 4, 2021

Is there any chance this could be used to add in database-specific queries? For example, a MySQL-specific query for faster hierarchy deletion (see #343)
-- @timdown

FWIW/ ancestry uses this concept to optimize database specific optimizations.
think this is a great start down that road.

@n-rodriguez n-rodriguez deleted the wip/database_type branch May 16, 2021 16:08
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.

4 participants