anada
October 8, 2020, 8:49am
1
Hello
If there’s a possibility to hide SQL query details in Redash API results?
k4s1m
October 12, 2020, 1:33pm
2
What do you mean by SQL query details?
anada
October 13, 2020, 10:28am
3
Hi @k4s1m
I mean SQL code itself
k4s1m
October 13, 2020, 1:19pm
4
You can modify redash/handlers/query_results.py
to not include the query text. I don’t think this breaks anything in the front-end.
beti
November 30, 2020, 12:23pm
6
This is a step by step guide for changing script redash/handlers/query_results.py inside docker
or just copy and replace this script query_results.py with the existing one, and then restart redash_server_1
Hide_Sql_code_Query_results_script.txt
#get inside container as root
sudo docker exec -u0 -ti redash_server_1 bash
# get inside redash/handlers/ folder where query_results.py script is
cd redash/handlers/
# make a copy of the query_results.py script with another name
cp query_results.py query_results_original.py
#edit the script using nano
# update and upgrade apt if needed to install nano if missing
sudo apt-get update && sudo apt-get upgrade && apt-get install nano
nano query_results.py
This file has been truncated. show original
query_results.py
import logging
import time
import unicodedata
from flask import make_response, request
from flask_login import current_user
from flask_restful import abort
from redash import models, settings
from redash.handlers.base import BaseResource, get_object_or_404, record_event
from redash.permissions import (has_access, not_view_only, require_access,
This file has been truncated. show original
2 Likes