internal T ExecuteFunction <T>(string function, params object[] arguments)
 {
     _connection.CheckConnectionReady();
     using (var command = new NpgsqlCommand(function, _connection))
     {
         command.CommandType = CommandType.StoredProcedure;
         command.CommandText = function;
         foreach (var argument in arguments)
         {
             command.Parameters.Add(new NpgsqlParameter()
             {
                 Value = argument
             });
         }
         return((T)command.ExecuteScalar());
     }
 }