Infinidat / infi.clickhouse_orm

A Python library for working with the ClickHouse database (https://clickhouse.yandex/)
BSD 3-Clause "New" or "Revised" License
411 stars 135 forks source link

create table issue use sqlalchemy-clickhouse #112

Open lyssom opened 5 years ago

lyssom commented 5 years ago

engine = create_engine('clickhouse://default:@localhost/test',encoding='utf-8',echo=True) Base = declarative_base() class Users(Base): tablename = 'users' id = Column(Integer,primary_key=True) name = Column(String(32)) password = Column(String(64)) engine = Engine() Base.metadata.create_all(engine) traceback like this: Exception: Code: 62, e.displayText() = DB::Exception: Syntax error: failed at position 45 (line 3, col 13): NOT NULL, name VARCHAR(32), password VARCHAR(64), PRIMARY KEY (id)

  I want create table use python code like this, but can't create it ,so what could i do to create it.
  thanks
ishirav commented 5 years ago

Isn't this an issue with sqlalchemy-clickhouse?