code: def where_filters(request, database, datasette):
      # This one deals with ?_where=
      async def inner():
          where_clauses = []
          extra_wheres_for_ui = []
          if "_where" in request.args:
              if not await datasette.permission_allowed(
                  request.actor,
                  "execute-sql",
                  resource=database,
                  default=True,
              ):
                  raise DatasetteError(
                      "_where= is not allowed", status=403
                  )
              else:
                  where_clauses.extend(request.args.getlist("_where"))
                  extra_wheres_for_ui = [
                      {
                          "text": text,
                          "remove_url": path_with_removed_args(
                              request, {"_where": text}
                          ),
                      }
                      for text in request.args.getlist("_where")
                  ]
  
          return FilterArguments(
              where_clauses,
              extra_context={
                  "extra_wheres_for_ui": extra_wheres_for_ui,
              },
          )
  
      return inner
  
imports: from datasette import hookimpl
  from datasette.views.base import DatasetteError
  from datasette.utils.asgi import BadRequest
  import json
  import numbers
  from .utils import detect_json1, escape_sqlite, path_with_removed_args
label_desc: Use image node_id 1 for calling a global function with example usage: where_filters(request, database, datasette) and returns: inner, FilterArguments