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

It would be nice to be able to define charsets for columns like this: #59

Open
roxblnfk opened this issue Oct 12, 2022 · 5 comments
Open

Comments

@roxblnfk
Copy link
Member

roxblnfk commented Oct 12, 2022

It would be nice to be able to define charsets for columns like this:

#[Entity]
class User
{
    #[Column(type: 'primary')]
    private int $id;

    #[Column(type: 'string', name: 'username', charset: 'latin1', collation: 'latin1_bin')]
    private string $email;
}

Originally posted by @ardabeyazoglu in cycle/orm#370

@ardabeyazoglu
Copy link

There can be columns with different charsets for both performance reasons and limitations. For example you cant index 255 char utf8mb4 column, but you could do it with latin1. Email is a good example

@roxblnfk
Copy link
Member Author

I think it possible using custom typecast handler. It won't work with migration generator but in PHP you will always work with UTF-8

@ardabeyazoglu
Copy link

ardabeyazoglu commented Oct 12, 2022

Php is not problem here anyway. But people who create schemas and migrations using the orm, might need it to prevent manual tricks. If it is possible using typecast handler, then there is no issue at all. Thanks for answering.

@ardabeyazoglu
Copy link

The actual implementation of annotation is here: https://github.com/cycle/annotated/blob/3.x/src/Annotation/Column.php
Should I create another issue there as well or you manage anything related from here ?

@roxblnfk roxblnfk transferred this issue from cycle/orm Oct 13, 2022
@roxblnfk
Copy link
Member Author

You are right.

or you manage anything related from here

I do it from here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants