def METHOD_NAME(cls, base_dir: str, inst_data: Optional[ConfigurableClassData] = None) -> Self:
    check.str_param(base_dir, "base_dir")
    mkdir_p(base_dir)
    conn_string = create_db_conn_string(base_dir, "runs")
    engine = create_engine(conn_string, poolclass=NullPool)
    alembic_config = get_alembic_config(__file__)
    should_mark_indexes = False
    with engine.connect() as connection:
        db_revision, head_revision = check_alembic_revision(alembic_config, connection)
        if not (db_revision and head_revision):
            RunStorageSqlMetadata.create_all(engine)
            connection.execute(db.text("PRAGMA journal_mode=WAL;"))
            stamp_alembic_rev(alembic_config, connection)
            should_mark_indexes = True
        table_names = db.inspect(engine).get_table_names()
        if "instance_info" not in table_names:
            InstanceInfo.create(engine)
    run_storage = cls(conn_string, inst_data)
    if should_mark_indexes:
        run_storage.migrate()
        run_storage.optimize()
    return run_storage