mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-08-02 19:20:14 +03:00
Merge 71cdbd8f80
into 45a9200ff6
This commit is contained in:
commit
8e7536fb4d
|
@ -224,7 +224,10 @@ class ModelBase(type):
|
||||||
# Tuples (poor man's version - convert to array)
|
# Tuples (poor man's version - convert to array)
|
||||||
if db_type.startswith('Tuple'):
|
if db_type.startswith('Tuple'):
|
||||||
types = [s.strip() for s in db_type[6 : -1].split(',')]
|
types = [s.strip() for s in db_type[6 : -1].split(',')]
|
||||||
assert len(set(types)) == 1, 'No support for mixed types in tuples - ' + db_type
|
if len(types[0].split()) != 1:
|
||||||
|
raise NotImplementedError('No support for named tuples - %s' % db_type)
|
||||||
|
if len(set(types)) != 1:
|
||||||
|
raise NotImplementedError('No support for mixed types in tuples - %s' % db_type)
|
||||||
inner_field = cls.create_ad_hoc_field(types[0])
|
inner_field = cls.create_ad_hoc_field(types[0])
|
||||||
return orm_fields.ArrayField(inner_field)
|
return orm_fields.ArrayField(inner_field)
|
||||||
# FixedString
|
# FixedString
|
||||||
|
|
|
@ -254,6 +254,8 @@ class DatabaseTestCase(TestCaseWithData):
|
||||||
for row in self.database.select(query):
|
for row in self.database.select(query):
|
||||||
if row.type.startswith('Map'):
|
if row.type.startswith('Map'):
|
||||||
continue # Not supported yet
|
continue # Not supported yet
|
||||||
|
if 'Tuple' in row.type:
|
||||||
|
continue # Not fully supported yet
|
||||||
ModelBase.create_ad_hoc_field(row.type)
|
ModelBase.create_ad_hoc_field(row.type)
|
||||||
|
|
||||||
def test_get_model_for_table(self):
|
def test_get_model_for_table(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user