Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to specify the collation of columns? #3

Open
kunzhipeng opened this issue Jun 25, 2012 · 5 comments
Open

Any way to specify the collation of columns? #3

kunzhipeng opened this issue Jun 25, 2012 · 5 comments

Comments

@kunzhipeng
Copy link

I noticed the collation of columns is always the same as the database. Any way to specify it?

e.g. The collation of the database is 'latin1', but i need to insert 'utf-8' chars. So i need to specify the collation of string columns as 'utf8'.

@tylerlong
Copy link
Owner

quick_orm is built-upon SQLAlchemy, so you might want to refer to SQLAlchemy's documentation.

check this page: http://docs.sqlalchemy.org/en/rel_0_7/core/types.html

@kunzhipeng
Copy link
Author

Thanks.

__table_args__ can be used for specifying charset of MySQL table.
Does quick_orm support __table_args__?

class Node(Base):
     __table_args__ = {'mysql_engine':'InnoDB','mysql_charset':'utf8'}

@tylerlong
Copy link
Owner

I think so. quick_orm does not compromise the power of SQLAlchemy. Please tell me if you meet issues.

@kunzhipeng
Copy link
Author

Yes. It works. I tested it just now. Thanks.

For what reason, it doesn't support __tablename__?

@tylerlong
Copy link
Owner

In the code of quick_orm, table names are generated by method camelcase_to_underscore, you can see it here: https://github.com/tylerlong/quick_orm/blob/master/quick_orm/core.py.

So it does not support user defined table name yet. But we can change that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants