-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
tinyint missing from getTypesMap() #2327
Comments
"Tiny integer" is not supported by many database vendors. DBAL's type system is an abstraction layer for SQL types including type conversion from PHP to database value and back. I am assuming that your issue refers to MySQL, where we do not have a distinct native SQL type to use for Hope this helps. |
A quick google search seems to indicate only postgres doesn't seem to include support for it; where a bigger smallint could be used as a viable alternative It doesn't make sense in my eyes not to include this natively as most widely-used databases support it (MySQL, MariaDB, SQL Server, SQLite, Oracle) Notable, Drizzle doesn't support smallint; yet smallint is fully supported, so presumably it shouldn't be an issue to support tinyint for everything but the above (and use smallint/int instead for them) |
Sorry, this won't be changed: you are free to use custom DBAL types in userland, but it won't be added to DBAL itself, as what @deeky666 said still stands. |
I'm sorry, but what part of it? I stated in my last comment how all but 2 of the supported databases support tinyint, and one of them doesn't support smallint either; yet smallint is supported in doctrine. This is just an inconsistency and one that doesn't make any sense in my eyes (and several others looking at the past activity in this thread, and popularity on google, SO, ... . |
As long as it's not supported by all of the platforms that we run with, it's gonna stay out of DBAL. Implementing a custom type in userland is trivial: do that instead. Here it won't be added for now. |
Then please explain how smallint is supported? (as Drizzle doesn't seem to support that either) |
It's mapped in dbal/lib/Doctrine/DBAL/Types/Type.php Line 65 in 0731608
That's extremely old and indeed a mistake that shouldn't be repeated. You have to look at this from a maintenance PoV: the more custom platform-specific features we add to DBAL, the more maintenance spawns (and that happens every time we add a bit of support for anything that isn't fully standard). I'm closing and locking here: ain't gonna happen, and that's final. |
The best way to explain this is probably to reference this issue:
laravel/framework#8840
The Laravel framework uses DBAL for alterations to existing fields. Basically, it looks like the tinyint definition is missing, at least from some aspects of DBAL. It's not possible to change an existing field to a tinyint - when you try, it returns the following error:
I was just wondering if maybe this was done for a reason? Or just an oversight?
If not - I'd love to try and contribute and fix this - are there any contributing guidelines or instructions?
The text was updated successfully, but these errors were encountered: