Skip to content

Open up for extensibility #129

@voltechs

Description

@voltechs

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:

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 ]
}.freeze

and
def operator_class(adapter)
klass = nil
OPERATOR_PATTERNS.each do |operator, keys|
klass = operator if keys.any? { |key| adapter[key] }
end
return klass if klass
raise UnsupportedDatabase, "Unsupported database type: #{adapter}"
end

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 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions