diff --git a/src/Plugin/migrate/source/CustomSQLQuery.php b/src/Plugin/migrate/source/CustomSQLQuery.php
index 3aee79e..1f07474 100644
--- a/src/Plugin/migrate/source/CustomSQLQuery.php
+++ b/src/Plugin/migrate/source/CustomSQLQuery.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\custom_sql_migrate_source_plugin\Plugin\migrate\source;
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Database\Statement\FetchAs;
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Database\StatementInterface;
 use Drupal\migrate\Plugin\migrate\source\SqlBase;
@@ -91,7 +93,7 @@ class CustomSQLQuery extends SqlBase {
    *   Query results.
    */
   private function getQueryResults(): ?StatementInterface {
-    return $this->getDatabase()->query($this->configuration['sql_query'], [], ['fetch' => \PDO::FETCH_ASSOC]);
+    return $this->getDatabase()->query($this->configuration['sql_query'], [], ['fetch' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => FetchAs::Associative, fn() => \PDO::FETCH_ASSOC)]);
   }
 
   /**
