jayvynl / django-clickhouse-backend

Django clickhouse database backend.
MIT License
128 stars 21 forks source link

Not sure how to handle Map(LowCardinality(String) #107

Open neoyagami opened 5 hours ago

neoyagami commented 5 hours ago

Hi. We use Django(3.2) to read an unmanaged table created by a secundary system,

In the database structure is created as

Map(LowCardinality(String), String)

we tried to set it as a JSON field

LogAttributes = models.JSONField(default=dict)

but the engine complains that the data already comes as a dict so for the moment the field is created as a TextField, Django (3.2) is smart enough to see it as a dict and expose it ready but querying it has become hard. even as a JSONField the normal methods ( BARModel.objects.filter(FOFIELD__key=value) ) arent compatible with the query system.

Is there a way to seamlesly use a Map inside django for querying?

thanks in advance.

neoyagami commented 5 hours ago

Nevermind, just found the documentation, thanks and sorry