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

Is it support typescript? #1157

Closed
hg-pyun opened this issue May 14, 2020 · 5 comments
Closed

Is it support typescript? #1157

hg-pyun opened this issue May 14, 2020 · 5 comments
Labels

Comments

@hg-pyun
Copy link

hg-pyun commented May 14, 2020

I don't see, @types/mysql2. Where is type definition?

@sidorares
Copy link
Owner

@hg-pyun see #1028 and #952

@hg-pyun
Copy link
Author

hg-pyun commented May 15, 2020

@sidorares Wow, Thank you for reply. It seems WIP.

@bradws
Copy link

bradws commented May 20, 2020

I went to install the types like:
npm i -D @types/mysql2
but npm couldn't find them in the registry.

I read that the API is mostly compatible with mysql, so i did a
npm i -D @types/mysql
which downloaded fine (I've use these types with mysql before on another project). Maybe a @types/mysql2 can be created?

So, I tried to begin to type in the code sample:

const mysql = require('mysql2');
const conn = mysql.

but the intellisense didn't work after typing in the dot '.' as I was looking for 'createConnection(...)'
Are you able to assist with getting the intellisense working in Visual Studio Code?

@bradws
Copy link

bradws commented May 25, 2020

As per #952 from @Cl00e9ment I ended up doing the following which worked for me :)

{
  ...
  "devDependencies": {
    ...
    "@types/mysql2": "git+https://git@github.com/types/mysql2.git"
  }
}

@hg-pyun hg-pyun closed this as completed Jun 8, 2020
@LinboLen
Copy link

personal mark.

  1. mysql2 better than mysql
  2. mysql2 not written with typescript.
  3. prepare statement support
  4. difference from official mysql lib

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

No branches or pull requests

4 participants