mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-10 19:36:33 +03:00
This commit is contained in:
parent
0391482ec7
commit
911af41ec1
|
@ -270,7 +270,7 @@ class Database(object):
|
|||
mapping = dict(db="`%s`" % self.db_name)
|
||||
if model_class:
|
||||
mapping['table'] = "`%s`.`%s`" % (self.db_name, model_class.table_name())
|
||||
query = Template(query).substitute(mapping)
|
||||
query = Template(query).safe_substitute(mapping)
|
||||
return query
|
||||
|
||||
def _get_server_timezone(self):
|
||||
|
|
|
@ -39,6 +39,10 @@ class DatabaseTestCase(TestCaseWithData):
|
|||
self.assertEqual(results[0].get_database(), self.database)
|
||||
self.assertEqual(results[1].get_database(), self.database)
|
||||
|
||||
def test_dollar_in_select(self):
|
||||
query = "SELECT * FROM $table WHERE first_name = '$utm_source'"
|
||||
list(self.database.select(query, Person))
|
||||
|
||||
def test_select_partial_fields(self):
|
||||
self._insert_and_check(self._sample_data(), len(data))
|
||||
query = "SELECT first_name, last_name FROM `test-db`.person WHERE first_name = 'Whitney' ORDER BY last_name"
|
||||
|
|
Loading…
Reference in New Issue
Block a user