开发者

CHARACTER SET COLLATE in MySQL and SQLAlchemy

开发者 https://www.devze.com 2022-12-07 21:03 出处:网络
I have a MySql table that has a column: CREATE TABLE names( `name` VARCHAR (100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NOT NULL);

I have a MySql table that has a column:

CREATE TABLE names(
    `name` VARCHAR (100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci NOT NULL);

I am tryint to ma开发者_开发知识库p the following column to it in MySqlAlchemy,

class Names(Base):
    __tablename__ = "folder"
    name = Column(VARCHAR, collation='utf8mb4_unicode_ci',nullable = False) 

and I am getting the following error:

TypeError: Additional arguments should be named <dialectname>_<argument>, got 'collation'

I tried searching around and found this but it's not working...

0

精彩评论

暂无评论...
验证码 换一张
取 消