Is your feature request related to a problem? Please describe.
We are migrating from https://github.com/xzkostyan/clickhouse-sqlalchemy and found that this project does not support SQLAlchemy's multi-row Insert.values(). This is because the dialect does not declare Dialect.supports_multivalues_insert:
conn.execute(t.insert().values([{"n": 1, "s": "a"}, {"n": 2, "s": "b"}]))
conn.execute(t.insert().values([(1, "a"), (2, "b")]))
conn.execute(t.insert().values([{"n": 1, "s": func.lower("A")}, {"n": 2, "s": func.lower("B")}]))
sqlalchemy.exc.CompileError: The 'clickhousedb' dialect with current database version settings does not support in-place multirow inserts.
This is surprising, given that ClickHouse itself accepts INSERT ... VALUES (...), (...). On the other hand the previously community maintained dialect and clickhouse-sqlalchemy enables the flag in drivers/base.py, so code written against it has to be rewritten when moving to clickhouse-connect.
Describe the solution you'd like
Set the flag next to the other supports_* attributes in cc_sqlalchemy/dialect.py:
supports_native_decimal = True
supports_native_boolean = True
+ supports_multivalues_insert = True
supports_statement_cache = False
Describe alternatives you've considered
conn.execute(t.insert(), rows) (executemany) covers plain rows but not per-row SQL expressions, and requires rewriting existing call sites.
Additional context
Is your feature request related to a problem? Please describe.
We are migrating from https://github.com/xzkostyan/clickhouse-sqlalchemy and found that this project does not support SQLAlchemy's multi-row
Insert.values(). This is because the dialect does not declareDialect.supports_multivalues_insert:This is surprising, given that ClickHouse itself accepts
INSERT ... VALUES (...), (...). On the other hand the previously community maintained dialect and clickhouse-sqlalchemy enables the flag in drivers/base.py, so code written against it has to be rewritten when moving to clickhouse-connect.Describe the solution you'd like
Set the flag next to the other
supports_*attributes incc_sqlalchemy/dialect.py:supports_native_decimal = True supports_native_boolean = True + supports_multivalues_insert = True supports_statement_cache = FalseDescribe alternatives you've considered
conn.execute(t.insert(), rows)(executemany) covers plain rows but not per-row SQL expressions, and requires rewriting existing call sites.Additional context