Hi.
I use [that](https://github.com/xzkostyan/clickhouse-sqlalchemy) library 
and tries to make migrations using alembic.

Here is simple implementation for that dialect:
```
class ClickHOuseImpl(postgresql.PostgresqlImpl):
    __dialect__ = 'clickhouse'
    transactional_ddl = False
```

Here is what I got after running `alembic init`:
```
op.create_table('order_logs',
    sa.Column('ts_spawn', clickhouse_sqlalchemy.types.UInt32(), 
nullable=False),
    sa.Column('platform_id', clickhouse_sqlalchemy.types.UInt32(), 
nullable=False),
    sa.Column('slave_prefix', clickhouse_sqlalchemy.types.String(), 
nullable=False),
    sa.Column('int_orders_ids', clickhouse_sqlalchemy.types.Array(<class 
'clickhouse_sqlalchemy.types.UInt32'>), nullable=False),
    sa.Column('state', clickhouse_sqlalchemy.types.UInt8(), nullable=False),
    sa.Column('step', clickhouse_sqlalchemy.types.UInt8(), nullable=False),
    sa.Column('ext_orders_ids', clickhouse_sqlalchemy.types.Array(<class 
'clickhouse_sqlalchemy.types.String'>), nullable=True),
    sa.Column('url', clickhouse_sqlalchemy.types.String(), nullable=True),
    sa.Column('request', clickhouse_sqlalchemy.types.String(), 
nullable=True),
    sa.Column('response', clickhouse_sqlalchemy.types.String(), 
nullable=True),
    sa.PrimaryKeyConstraint('ts_spawn', 'platform_id', 'slave_prefix', 
'int_orders_ids', 'state', 'step')
    )
```
As you can see array-elements generated not correct: nested types have 
`<class...>` substring.

`alembic.autogenerate.render._repr_type` shows me, that custom 
representation of types uses only if module_name startswith 
`sqlalchemy.dialects`:
```
...
    if hasattr(autogen_context.migration_context, 'impl'):
        impl_rt = autogen_context.migration_context.impl.render_type(
            type_, autogen_context)
    else:
        impl_rt = None

    mod = type(type_).__module__
    imports = autogen_context.imports
    if mod.startswith("sqlalchemy.dialects"):
        dname = re.match(r"sqlalchemy\.dialects\.(\w+)", mod).group(1)
        if imports is not None:
            imports.add("from sqlalchemy.dialects import %s" % dname)
        if impl_rt:
            return impl_rt
...
```

Is there any ways to fix the problem?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to