-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Defaults Varchar(255) and UTF8mb4 #4627
Comments
@Betanu701 Thanks for posting, we'll take a look as soon as possible. For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her minions in Austin, click here. |
The alternatives are: For non indexes no changes should be required. There’s also other workarounds but they would be unnecessary for most users(but could include as an option?):
(Plan C here) |
@Betanu701, for performance reasons, we leave the sizing of fields up to the adaptor (sails-mssql in your case) as each adaptor passes data straight through to the database. I think you’re on the right track though, being aware of what your charset is. as @vpiskunov hints, when you know what your charset is, you can handle it in code first before sending it to your database |
@Betanu701 @vpiskunov I just came across this - hopefully this can be helpful for you as well: https://sailsjs.com/documentation/concepts/models-and-orm/attributes#?unique |
@oaksofmamre @vpiskunov @Betanu701 - Hey everyone, we're moving the Waterline issues to Sails (balderdashy/sails) for closer management and greater exposure. I see a couple of responses to the original case so far - feel free to provide updates if this is pending a resolution. Thanks for all the information so far, I hope the currently suggested docs have been helpful. |
Waterline version:0.13
Node version:8.#
NPM version:5.*
Operating system:linux
Note: this really should be for sails-mysql
So there is an issue with MariaDB/Mysql especially on linux machines fresh install of MariaDB. The issue comes from charset UTF8mb4 -> This is the default for MariaDB with a fresh install. The issue comes down to default varchar being set to VARCHAR(255). With UTF8mb4, one can not use VARCHAR(255).
The issue by default strings are defaulting to varchar then to VARCHAR(255). I am not sure if there is a way that we can detect what the charset is currently.
I still like defaulting to 255 because I use UTF8. However this becomes a huge pain for those who do not know that there is a difference and are not wanting to go into setting up their machines to a different character set.
I really do not know the best way to go forward with this issue. My thought would be to have it in the configs so that we can override the default. Not sure though.
The text was updated successfully, but these errors were encountered: