Skip to content

Commit

Permalink
Merge pull request getredash#88 from KiiCorp/schema-prefix-84
Browse files Browse the repository at this point in the history
Add environment variable for prefixing schema name.
  • Loading branch information
shinsuke-nara authored Aug 1, 2019
2 parents d815203 + 339df63 commit 0f96547
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions redash/query_runner/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


from inspect import ismethod
from redash import varanus

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -201,6 +202,8 @@ def tenant_id2name(tenant_id):

tid = Python.to_tenant_id_int(tenant_id)

if varanus.DBOBJ_PREFIX != '':
return "%s_tenant_%d" % (varanus.DBOBJ_PREFIX, tid,)
return "tenant_%d" % tid

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions redash/varanus.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ def varanus_render(template, context=None, **kwargs):


CHROMELOGGER_ENABLED = parse_boolean(os.environ.get("VARANUS_REDASH_CHROMELOGGER_ENABLED", "false"))
DBOBJ_PREFIX=os.environ.get('VARANUS_REDASH_DATABASE_OBJECTPREFIX', '')

0 comments on commit 0f96547

Please sign in to comment.