Skip to content

Modify SQLCatalog initialization so that classes are not always created and update how these classes are created to be more open to tother DB's #1148

@isc-psulin

Description

@isc-psulin

Feature Request / Improvement

I think there are 2 issues with the SQLCatalog constructor:

def __init__(self, name: str, **properties: str):

  1. The automatic creation of non-existent SQLCatalog tables is great for testing, but not something I would want in code that was being deployed and run even in a QA environ. Applying DDL should be part of a seperate process. Constructor should at least take a parameter that allows you to not create the tables automatically.
  2. The current method used for creating the tables in _ensure_tables_exists uses exceptions which means that the library is compatible with SQLite and Postgres simply because the except clause handles the errors these DB's throw when selecting from a non-existant DB. The logic here should just check for the existence of the tables through a standard SQLAlchemy method, which will also make the SQLCatalog work with most DBs

I have made these changes on my local branch and can submit a PR but wanted to open up conversation to other opinions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions