-
Notifications
You must be signed in to change notification settings - Fork 49
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
Open up for extensibility #129
Comments
Hi @voltechs - thanks for getting in touch, and it's great to know you find Combustion so helpful! Also: I'm very keen to make additional database support possible. I suspect the |
Hi @pat, that would definitely be a step in the right direction. Of course, class Combustion::Database::Reset
# ...
@@operator_patterns = {
Combustion::Databases::MySQL => [/mysql/],
Combustion::Databases::PostgreSQL => [/postgres/, /postgis/],
Combustion::Databases::SQLite => [/sqlite/],
Combustion::Databases::SQLServer => [/sqlserver/],
Combustion::Databases::Oracle => %w[ oci oracle ],
Combustion::Databases::Firebird => %w[ firebird ]
}
# ...
def operator_class(adapter)
klass = nil
@@operator_patterns do |operator, keys|
klass = operator if keys.any? { |key| adapter[key] }
end
return klass if klass
raise UnsupportedDatabase, "Unsupported database type: #{adapter}"
end
end Also, off-topic: would it make sense to simplify the def operator_class(adapter)
@@operator_patterns do |operator, keys|
return operator if keys.any? { |key| adapter[key] }
end
raise UnsupportedDatabase, "Unsupported database type: #{adapter}"
end Especially after opening up the hash to modification, there's a chance of traversing the whole hash even after finding a match. |
Given we can rely on ActiveSupport being present, perhaps
Your simplification of Also, I'm wondering if this attribute, the |
Sounds good. I'll try to take a stab at creating a PR here when I've got a few spare cycles! |
Hi @pat!
I'm such a huge fan of Combustion; I was working on a new project and was looking to leverage Combustion for it.
Sadly I may be at an impasse. I'm trying to use the Snowflake DB, through a few different gems and configs. All in vein though, it would seem, as Combustion seems to be pretty stubborn on what databases it supports.
That is to say, without a substantial amount of "hacking", combustion has it's list of supported databases pretty locked down, unavailable for modification or extension from end users/developers.
Specifically:
combustion/lib/combustion/database/reset.rb
Lines 9 to 16 in 8916f6b
and
combustion/lib/combustion/database/reset.rb
Lines 52 to 60 in 8916f6b
Any thoughts on making that a little less rigid and available for others to append/modify as they might see fit?
Thanks for the consideration in advance 🙂
The text was updated successfully, but these errors were encountered: