diff --git a/mara_catalog/cli.py b/mara_catalog/cli.py index 8271dc9..f11cf1a 100644 --- a/mara_catalog/cli.py +++ b/mara_catalog/cli.py @@ -56,7 +56,8 @@ def create_schema_if_not_exist(db_alias: str, schema_name: str) -> bool: eng = mara_db.sqlalchemy_engine.engine(db_alias) with eng.connect() as conn: - if eng.dialect.has_schema(connection=conn, schema_name=schema_name): + insp = sqlalchemy.inspect(eng) + if insp.has_schema(schema_name=schema_name, connection=conn): print(f'Schema {schema_name} already exists') else: create_schema = sqlalchemy.schema.CreateSchema(schema_name)