You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (f'{app_label}.{model_name}'inself.route_model_names
134
+
or hints.get('clickhouse')):
135
+
return db =='clickhouse'
136
+
elif db =='clickhouse':
137
+
returnFalse
138
+
returnNone
139
+
```
140
+
141
+
You should use [database router](https://docs.djangoproject.com/en/4.1/topics/db/multi-db/#automatic-database-routing) to
142
+
automatically route your queries to the right database. In the preceding example, I write a database router which route all
143
+
queries from subclasses of `clickhouse_backend.models.ClickhouseModel` or custom migrations with a `clickhouse` hint key to clickhouse.
144
+
All other queries are routed to the default database (postgresql).
85
145
86
146
`DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'` is required to working with django migration.
87
147
More details will be covered in [DEFAULT_AUTO_FIELD](https://github.com/jayvynl/django-clickhouse-backend/blob/main/docs/Configurations.md#default_auto_field).
@@ -317,33 +377,7 @@ $ tox
317
377
Changelog
318
378
---
319
379
320
-
### 1.0.1 (2023-02-23)
321
-
322
-
- Add `return_int` parameter to `Enum[8|16]Field` to control whether to get an int or str value when querying from the database.
0 commit comments