@tdd_issue @tdd_issue_10507
Feature: TDD Issue #10507 — get_current_revision() must pass check_same_thread=False for SQLite
  As a developer using MigrationRunner in a multi-threaded application
  I want get_current_revision() to work safely from background threads
  So that async startup flows and background migration checks do not crash

  The root cause is that MigrationRunner.get_current_revision() calls
  create_engine(self.database_url) without connect_args={"check_same_thread": False}
  for SQLite databases.  When called from a thread other than the one that
  created the engine, SQLite raises:
      ProgrammingError: SQLite objects created in a thread can only be
      used in that same thread.

  The sibling method init_or_upgrade() already passes check_same_thread=False
  for SQLite, making this an inconsistency in the same class.  Because
  get_pending_migrations() and check_migrations_needed() both delegate to
  get_current_revision(), the threading bug propagates to all three methods.

  The fix adds connect_args={"check_same_thread": False} to the create_engine()
  call in get_current_revision() when the database URL starts with "sqlite",
  consistent with the existing pattern in init_or_upgrade().

  Scenario: get_current_revision passes check_same_thread=False for SQLite engine
    Given a migration runner configured for "sqlite:///:memory:"
    When I request the current revision and capture the engine creation args
    Then the SQLite engine should be created with check_same_thread set to False

  Scenario: get_current_revision does not pass check_same_thread for non-SQLite engine
    Given a migration runner configured for "postgresql://user:pass@localhost/testdb"
    When I request the current revision and capture the engine creation args
    Then the non-SQLite engine should be created without check_same_thread
