knex-db-manager icon indicating copy to clipboard operation
knex-db-manager copied to clipboard

The encoding/charset is hard coded to 'utf8'

Open wywywywy opened this issue 5 years ago • 1 comments

The encoding is hard coded to 'utf8', which can cause a ER_COLLATION_CHARSET_MISMATCH error.

As 'utf8' is not compatible with a number of collations, e.g. the utf8mb4 variants, some of the functions will not work.

What it should do, is to use the one in config.knex.connection.charset if specified, alternatively we can have a new entry config.dbManager.charset.

I am speaking in the context of MySQL because I'm not too familiar with Postgres, but I guess it's probably the same.

Example -

https://github.com/Vincit/knex-db-manager/blob/8bd87a39f02fd62e5ba342c7b74ab07376a7803f/lib/MySqlDatabaseManager.js#L51

wywywywy avatar Oct 18 '19 00:10 wywywywy

I would prefer config.dbManager.charset feel free to send PR for this.

elhigu avatar Feb 10 '20 15:02 elhigu