Closed Devvypaws closed 2 years ago
Kysely has tests for this and they all pass.
Well, your fix seems to also work so I'll merge it.
Yeah, I was confused as to why it was happening because I expected the returned columns to just match the case they are in the system. But even testing it out myself, I got that same behavior. Nonetheless, the casings matching the expected output couldn't hurt. :-)
Overview
The MySQL Introspector selects columns from
information_schema.columns
in lowercase, butparseTableMetadata()
expects the columns to be uppercase, causing it to throw.Environment
Node: 18.6.0 Kysely: 0.19.12 and 0.21.1 MySQL: 5.7.33
Research
The result of the query MySQL Introspector uses was inspected and found to output the following:
However,
parseTableMetadata()
expects these fields to be uppercase:This causes it to throw the following error:
It appears the casing of the
SELECT
statement affects the returned results, as confirmed by both a manual query of the database and also modifyingto use uppercase, which returns the expected column names and succeeds.