Follow mini_sql a bit closer and use raw_connection for constructor since this is critical for discourse

Follow mini_sql a bit closer and use raw_connection for constructor since this is critical for discourse

diff --git a/lib/mini_sql/postgres_jdbc/connection.rb b/lib/mini_sql/postgres_jdbc/connection.rb
index 0d46c5e..5b3b0c4 100644
--- a/lib/mini_sql/postgres_jdbc/connection.rb
+++ b/lib/mini_sql/postgres_jdbc/connection.rb
@@ -14,9 +14,8 @@ module MiniSql
       # @param raw_connection [PG::Connection] an active connection to PG
       # @param deserializer_cache [MiniSql::DeserializerCache] a cache of field names to deserializer, can be nil
       # @param type_map [PG::TypeMap] a type mapper for all results returned, can be nil
-      def initialize(connection, args = nil)
-        @connection = connection
-        @raw_connection = connection.raw_connection
+      def initialize(raw_connection, args = nil)
+        @raw_connection = raw_connection
         @deserializer_cache = (args && args[:deserializer_cache]) || self.class.default_deserializer_cache
         @param_encoder = (args && args[:param_encoder]) || InlineParamEncoder.new(self)
       end
@@ -59,7 +58,7 @@ module MiniSql
       end
 
       def escape_string(str)
-        @connection.quote_string(str)
+        raw_connection.escape_string(str)
       end
 
       private
diff --git a/test/test_helper.rb b/test/test_helper.rb
index cb3b924..08725e0 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -13,7 +13,7 @@ if RUBY_ENGINE == 'jruby'
   def pg_connection
     config = {adapter: 'postgresql', dbname: 'test_mini_sql', password: ENV['PASSWORD'] }
     pg_conn = ActiveRecord::Base.establish_connection(**config).checkout
-    MiniSql::Connection.get(pg_conn)
+    MiniSql::Connection.get(pg_conn.raw_connection)
   end
 else
   require "pg"

GitHub sha: 386d22a2