Closed jean-bernard-valentaten closed 5 years ago
@akaplya can you review it pls it looks good to me
Kann be merged told me @akaplya
Feedback after review with @akaplya, @buskamuza and @fascinosum
Also need to consider
@melnikovi in PHP we do not have enum type to archive this we need to use a library like https://github.com/spatie/enum or https://docs.spatie.be/enum/v2/introduction/.
@larsroettig I was referring to this https://www.php.net/manual/en/class.splenum.php.
@melnikovi I have a couple of questions about you considerations:
Introducing enums for collation and charset
Fine with me, but bear in mind that these vary from RDBMS to RDBMS, thus those enums would have to be located in the DBAL.
What should be return type of getDefaultValue?
Can you elaborate what you mean exactly? Imho the return type of getDefaultValue
should be tied to the type of column but if you want it to be a generic type, I'd suggest making it ?string
. Is that what you are trying to say?
What should be return type of getOnUpdate?
What do you propose?
Introduce enum for engine. Need to think what MySQL engines do we need to support and create enum based on that
I added that to the proposal. We may not be able to use SplEnum
though as it is contained in a PECL package only.
Need to remove TYPE from column classes
I removed them as requested
Remove InformationSchema\Table\IntColumn:: getType and create different classes instead
That was already done, there are type specific classes for all ANSI-SQl variants of integer
.
Open questions will be finalized in subsequent proposals.
Problem
This is a subset of #264 , covering only COLUMNS and TABLES interfaces.
Different RDBMS return Information Schema (metadata) information in different format. Magento framework should allow to switch between different implementations in order to support those different versions of DBs, as well as differences between versions.
Solution
Introduce granular interfaces, based in Information Schema standard (looking into MySQL and MariaDB definitions in this scope, links are in the document). Application can switch between different implementation based on the profile.