Skip to content

Commit 8e868fd

Browse files
committed
Removing quote method for table name
1 parent 1a0d8d9 commit 8e868fd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

django_spanner/introspection.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def get_relations(self, cursor, table_name):
167167
rc.UNIQUE_CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
168168
WHERE
169169
tc.TABLE_SCHEMA=@schema_name AND tc.TABLE_NAME=@view_name
170-
""", params={"schema_name": schema_name, "view_name": self.connection.ops.quote_name(table_name)}
170+
""", params={"schema_name": schema_name, "view_name": table_name}
171171
)
172172
return {
173173
column: (referred_column, referred_table)
@@ -199,7 +199,7 @@ def get_primary_key_column(self, cursor, table_name):
199199
ccu ON tc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
200200
WHERE
201201
tc.TABLE_NAME=@table_name AND tc.CONSTRAINT_TYPE='PRIMARY KEY' AND tc.TABLE_SCHEMA=@schema_name
202-
""", params={"schema_name": schema_name, "table_name": self.connection.ops.quote_name(table_name)}
202+
""", params={"schema_name": schema_name, "table_name": table_name}
203203
)
204204
return results[0][0] if results else None
205205

@@ -216,7 +216,6 @@ def get_constraints(self, cursor, table_name):
216216
:returns: A dictionary with constraints.
217217
"""
218218
constraints = {}
219-
quoted_table_name = self.connection.ops.quote_name(table_name)
220219
schema_name = self._get_schema_name(cursor)
221220

222221
# Firstly populate all available constraints and their columns.
@@ -227,7 +226,7 @@ def get_constraints(self, cursor, table_name):
227226
FROM
228227
INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
229228
WHERE TABLE_NAME=@table AND TABLE_SCHEMA=@schema_name''',
230-
params={"table": quoted_table_name, "schema_name": schema_name}
229+
params={"table": table_name, "schema_name": schema_name}
231230
)
232231
for constraint, column_name in constraint_columns:
233232
if constraint not in constraints:
@@ -357,7 +356,7 @@ def get_key_columns(self, cursor, table_name):
357356
rc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
358357
WHERE
359358
tc.TABLE_NAME=@table AND tc.TABLE_SCHEMA=@schema_name
360-
""", params={"table": self.connection.ops.quote_name(table_name), "schema_name": schema_name}
359+
""", params={"table": table_name, "schema_name": schema_name}
361360
)
362361
key_columns.extend(cursor.fetchall())
363362
return key_columns

0 commit comments

Comments
 (0)