You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output returned seems to an object array with upper case TABLE_NAME as the key name, while the map is looking for the lowercase table_name, which causes tableNames to be an empty array.
Currently, the only workaround I can see for this is to do add an alias as to the select query:
this._cachedTableNames = knex('information_schema.tables')
// 👋👋 Force knex to return lowercase `table_name`
.select('table_name AS table_name')
.where('table_schema', config.knex.connection.database)
// .. other stuff
Can you think of any other workarounds? Do you think something could be wrong with the MySQL macOS installation on my Mac?
The text was updated successfully, but these errors were encountered:
I haven't ran mysql server natively on mac for a very long time. I always run it in docker... So there might be a bug or mysql on mac might work somehow different manner.
Can you add reproduction code for this and also tell how have you installed mysql on mac?
Apologies for the barrage of
truncateDb
bugs!After applying my workaround, I was able to bypass #83. I ran the command in Ubuntu and I was able to get the truncation to work!
I ran the same command on macOS, and it does not do the truncation 😱
I started doing some debugging, and I logged out the result of
tableNames
from https://github.com/Vincit/knex-db-manager/blob/master/lib/MySqlDatabaseManager.js#L133The output returned seems to an object array with upper case
TABLE_NAME
as the key name, while themap
is looking for the lowercasetable_name
, which causestableNames
to be an empty array.Currently, the only workaround I can see for this is to do add an alias
as
to the select query:Can you think of any other workarounds? Do you think something could be wrong with the MySQL macOS installation on my Mac?
The text was updated successfully, but these errors were encountered: