Creating a plugin to override QUERY_RESULT_MAX_LIMIT

Apparently this hasn’t been a high priority for ranyone in the past 2 years, but I needed this today and solved it by editing the file by hand inside the container.

A workaround is something like the below in app.yml:

  after_bundle_exec:
   - replace:
        filename: "/var/www/discourse/plugins/discourse-data-explorer/plugin.rb"
        from: /QUERY_RESULT_MAX_LIMIT = 10_000/
        to: QUERY_RESULT_MAX_LIMIT = 100_000

But it looks like the PR would be something like adding this to plugin.rb:

GlobalSetting.add_default(:query_result_max_limit, 10000)

and then changing the above module to something like

  QUERY_RESULT_MAX_LIMIT = GlobalSetting.query_result_max_limit || 10_000

Is that all it would take?