diff --git a/src/Lunr/Gravity/Database/DatabaseConnection.php b/src/Lunr/Gravity/Database/DatabaseConnection.php
index 95d0a10c961f9a99f13994dd8517084060910de4..2118f149c616da4fc63ed2614d54b0d3004d9945 100644
--- a/src/Lunr/Gravity/Database/DatabaseConnection.php
+++ b/src/Lunr/Gravity/Database/DatabaseConnection.php
@@ -17,7 +17,7 @@ use \Psr\Log\LoggerInterface;
 /**
  * This class defines abstract database access.
  */
-abstract class DatabaseConnection
+abstract class DatabaseConnection implements DatabaseEscaperInterface
 {
 
     /**
diff --git a/src/Lunr/Gravity/Database/DatabaseEscaperInterface.php b/src/Lunr/Gravity/Database/DatabaseEscaperInterface.php
new file mode 100644
index 0000000000000000000000000000000000000000..6c5c9f3a999351074505762712a3c3094dfe7081
--- /dev/null
+++ b/src/Lunr/Gravity/Database/DatabaseEscaperInterface.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * Database escaper interface.
+ *
+ * @package    Lunr\Gravity\Database
+ * @author     Heinz Wiesinger <heinz@m2mobi.com>
+ * @copyright  2023, Move Agency B.V., Zwolle, The Netherlands
+ * @license    http://lunr.nl/LICENSE MIT License
+ */
+
+namespace Lunr\Gravity\Database;
+
+/**
+ * This interface defines the query escape primitives.
+ */
+interface DatabaseEscaperInterface
+{
+
+    /**
+     * Return a new instance of a QueryEscaper object.
+     *
+     * @return DatabaseQueryEscaper $escaper New DatabaseQueryEscaper object instance
+     */
+    public function get_query_escaper_object();
+
+    /**
+     * Escape a string to be used in a SQL query.
+     *
+     * @param string $string The string to escape
+     *
+     * @return mixed $return The escaped string on success, FALSE on error
+     */
+    public function escape_string($string);
+
+}
+
+?>
diff --git a/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php b/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php
index 93ea3e2b5dfbcde5f26f8895234b973de7c852b3..fc75d99dab757c3e923c950a21a3830e5cff69f3 100644
--- a/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php
+++ b/src/Lunr/Gravity/Database/DatabaseQueryEscaper.php
@@ -26,7 +26,7 @@ abstract class DatabaseQueryEscaper implements QueryEscaperInterface
 
     /**
      * Instance of the Database Connection.
-     * @var DatabaseConnection
+     * @var DatabaseEscaperInterface
      */
     protected $db;
 
@@ -45,7 +45,7 @@ abstract class DatabaseQueryEscaper implements QueryEscaperInterface
     /**
      * Constructor.
      *
-     * @param DatabaseConnection $db Instance of the DatabaseConnection class.
+     * @param DatabaseEscaperInterface $db Instance of a class implementing the DatabaseEscaperInterface.
      */
     public function __construct($db)
     {
diff --git a/src/Lunr/Gravity/Database/MySQL/MySQLQueryEscaper.php b/src/Lunr/Gravity/Database/MySQL/MySQLQueryEscaper.php
index b4b392ce67aabe89273fc06e7a98a285d8089ccc..bb07beda27c11e491c38a811565005f03d280b75 100644
--- a/src/Lunr/Gravity/Database/MySQL/MySQLQueryEscaper.php
+++ b/src/Lunr/Gravity/Database/MySQL/MySQLQueryEscaper.php
@@ -26,7 +26,7 @@ class MySQLQueryEscaper extends DatabaseQueryEscaper
     /**
      * Constructor.
      *
-     * @param MySQLConnection $db Instance of the MySQLConnection class.
+     * @param DatabaseEscaperInterface $db Instance of a class implementing the DatabaseEscaperInterface.
      */
     public function __construct($db)
     {
diff --git a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryEscaperTest.php b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryEscaperTest.php
index 9330db060076ddb586202a7978937101cce13d4f..87bb416c954b99b68e2403ee0bba9bdce1e0e512 100644
--- a/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryEscaperTest.php
+++ b/src/Lunr/Gravity/Database/MySQL/Tests/MySQLQueryEscaperTest.php
@@ -24,8 +24,8 @@ abstract class MySQLQueryEscaperTest extends LunrBaseTest
 {
 
     /**
-     * Mock instance of the MySQLConnection class.
-     * @var MySQLConnection
+     * Mock instance of a class implementing the DatabaseEscaperInterface.
+     * @var DatabaseEscaperInterface
      */
     protected $db;
 
@@ -34,8 +34,7 @@ abstract class MySQLQueryEscaperTest extends LunrBaseTest
      */
     public function setUp(): void
     {
-        $this->db = $this->getMockBuilder('Lunr\Gravity\Database\MySQL\MySQLConnection')
-                         ->disableOriginalConstructor()
+        $this->db = $this->getMockBuilder('Lunr\Gravity\Database\DatabaseEscaperInterface')
                          ->getMock();
 
         $this->class = new MySQLQueryEscaper($this->db);
diff --git a/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php b/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php
index 150c9b03ca7196ebae6b783110ff3fd208e5464a..ba41f8336c19eac67e326ee45d68e39d1521208d 100644
--- a/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php
+++ b/src/Lunr/Gravity/Database/SQLite3/SQLite3QueryEscaper.php
@@ -34,7 +34,7 @@ class SQLite3QueryEscaper extends DatabaseQueryEscaper
     /**
      * Constructor.
      *
-     * @param SQLite3Connection $db Instance of the SQLite3Connection class.
+     * @param DatabaseEscaperInterface $db Instance of a class implementing the DatabaseEscaperInterface.
      */
     public function __construct($db)
     {
diff --git a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryEscaperTest.php b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryEscaperTest.php
index be084ff5f4e8341565ee9b65844f3ade39f3f779..d77e432da4036294a87f273b1279908396c8ac80 100644
--- a/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryEscaperTest.php
+++ b/src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryEscaperTest.php
@@ -24,8 +24,8 @@ abstract class SQLite3QueryEscaperTest extends LunrBaseTest
 {
 
     /**
-     * Mock instance of the SQLite3Connection class.
-     * @var SQLite3Connection
+     * Mock instance of a class implementing the DatabaseEscaperInterface.
+     * @var DatabaseEscaperInterface
      */
     protected $db;
 
@@ -34,8 +34,7 @@ abstract class SQLite3QueryEscaperTest extends LunrBaseTest
      */
     public function setUp(): void
     {
-        $this->db = $this->getMockBuilder('Lunr\Gravity\Database\SQLite3\SQLite3Connection')
-                         ->disableOriginalConstructor()
+        $this->db = $this->getMockBuilder('Lunr\Gravity\Database\DatabaseEscaperInterface')
                          ->getMock();
 
         $this->class = new SQLite3QueryEscaper($this->db);
diff --git a/src/Lunr/Gravity/Database/Tests/DatabaseQueryEscaperTest.php b/src/Lunr/Gravity/Database/Tests/DatabaseQueryEscaperTest.php
index 99e590ca4df84af5fc34bfbd0b5e3f255cff7d7f..c648a8a734d937c3533fac3b40733b5dca3b9324 100644
--- a/src/Lunr/Gravity/Database/Tests/DatabaseQueryEscaperTest.php
+++ b/src/Lunr/Gravity/Database/Tests/DatabaseQueryEscaperTest.php
@@ -25,8 +25,8 @@ abstract class DatabaseQueryEscaperTest extends LunrBaseTest
 {
 
     /**
-     * Mock instance of the DatabaseConnection class.
-     * @var DatabaseConnection
+     * Mock instance of a class implementing the DatabaseEscaperInterface.
+     * @var DatabaseEscaperInterface
      */
     protected $db;
 
@@ -35,9 +35,8 @@ abstract class DatabaseQueryEscaperTest extends LunrBaseTest
      */
     public function setUp(): void
     {
-        $this->db = $this->getMockBuilder('Lunr\Gravity\Database\DatabaseConnection')
-                         ->disableOriginalConstructor()
-                         ->getMockForAbstractClass();
+        $this->db = $this->getMockBuilder('Lunr\Gravity\Database\DatabaseEscaperInterface')
+                         ->getMock();
 
         $this->class = $this->getMockBuilder('Lunr\Gravity\Database\DatabaseQueryEscaper')
                             ->setConstructorArgs([ $this->db ])
