Skip to content

Commit d3bcbc8

Browse files
committed
fix for table names with schema
1 parent 1eca89b commit d3bcbc8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

django_iris/operations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class DatabaseOperations(BaseDatabaseOperations):
1414
def quote_name(self, name):
1515
if name.startswith('"') and name.endswith('"'):
1616
return name # Quoting once is enough.
17+
if '.' in name:
18+
return ".".join(['"%s"' % n for n in name.split('.')])
1719
return '"%s"' % name
1820

1921
def last_insert_id(self, cursor, table_name, pk_name):

django_iris/schema.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ def quote_value(self, value):
2727
return "NULL"
2828
return value
2929

30+
def quote_name(self, name):
31+
if '.' in name:
32+
return name
33+
return self.connection.ops.quote_name(name)
34+
3035
def prepare_default(self, value):
3136
return self.quote_value(value)
3237

0 commit comments

Comments
 (0)