Open erosennin opened 4 years ago
It seems that there are some deep problems with Nested columns.
If you want it "just work" right now you can replace Nested with list of Array columns. But, accessing these columns with __getattr__
will be painful:
import sqlalchemy as sa
from clickhouse_sqlalchemy import engines, types, select
engine = sa.create_engine("clickhouse+native://localhost/default", echo=True)
metadata = sa.MetaData()
family = sa.Table(
"family",
metadata,
sa.Column("id", types.UInt32, primary_key=True),
sa.Column("members.age", types.Array(types.UInt32)),
engines.Memory(),
)
metadata.create_all(engine)
engine.execute(family.insert(), [{"id": 1, "members.age": [7, 31, 33]}])
print(engine.execute(select([family.c.id, getattr(family.c, 'members.age')])).fetchall())
You need to bind metadata and engine + add databasename
Describe the bug There seems to be no way to specify the values of nested columns when inserting data.
To Reproduce
The nested column
members.age
is ignored:Expected behavior
Versions