We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf40e41 commit e61ad9aCopy full SHA for e61ad9a
clickhouse_backend/driver/client.py
@@ -5,7 +5,7 @@
5
6
from .escape import escape_params
7
8
-insert_pattern = re.compile(r'\s*insert\s+into', flags=re.IGNORECASE)
+insert_pattern = re.compile(r'\s*insert\s+into.+?values\s*', flags=re.IGNORECASE)
9
10
11
class Client(client.Client):
tests/basic/tests.py
@@ -829,3 +829,10 @@ def test_saving_an_object_again_does_not_create_a_new_object(self):
829
a.headline = "Updated headline"
830
a.save()
831
self.assertEqual(a.id, current_id)
832
+
833
834
+class RawSQLTest(TestCase):
835
+ def test_insert_select(self):
836
+ table = Article._meta.db_table
837
+ with connections[DEFAULT_DB_ALIAS].cursor() as cursor:
838
+ cursor.execute(f'insert into {table} select * from {table}')
0 commit comments