Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typings: MySQL option dateStrings has incorrect type #3901

Open
tkalliom opened this issue Jun 29, 2020 · 1 comment
Open

Typings: MySQL option dateStrings has incorrect type #3901

tkalliom opened this issue Jun 29, 2020 · 1 comment

Comments

@tkalliom
Copy link
Contributor

Environment

Knex version: master
Database + version: MySQL
OS: Linux

Issue is about TypeScript definitions, @lorefnon

Bug

The MySQL options have the field dateStrings?: boolean;. In addition to a boolean, the MySQL also supports giving a list of types which should be converted to strings. The corresponding definition in @types/mysql is dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>;. I was thinking perhaps the driver-specific part should actually be imported from @types/mysql, but maybe there is some reason it is not done that way?

@kibertoad
Copy link
Collaborator

Problem with importing external types is that if you make them a runtime dependency, they will be retained on runtime for everyone, and if you make them a devDependency, then TS builds for all users who haven't added them manually will start to fail too.
Would you be open to submitting a PR to fix the types?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants