Closed mathieulb closed 2 years ago
mysql2 doesn't include the typings for typescript for the error codes in their package. That's where I used it for
Yeah, I found that a month ago, when replacing mysql
by mysql2
; the list of errors is somewhere in mysql2
, but it's not possible to reach it using import
, if I understood correctly. I started using mysql-error-codes
just so as to not depend on both mysql
and mysql2
.
... and I don't know why I didn't realise about TS support before. I had the impression that I had compile-time support (and thus editor completions) when using mysql's errors, but that wasn't true, I only was using runtime lookup.
BTW lookup of string by errno is missing in the TS typing. I'm going to open a different ticket for that.
compare your package with what can already be done using :