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

Missing Types - Pool Events #86

Closed
MatthewJohnSymons opened this issue Nov 15, 2019 · 2 comments
Closed

Missing Types - Pool Events #86

MatthewJohnSymons opened this issue Nov 15, 2019 · 2 comments

Comments

@MatthewJohnSymons
Copy link

I am using Typescript and all of its glorious type checking with the mariadb package. When creating a pool and then wanting to listen for the four pool events, I get an error:

Property 'on' does not exist on type 'Pool'.

Using the following code, mostly as per the docs but instead using import rather than require so that it picks up the declaration file:

import mariadb from 'mariadb';
const pool = mariadb.createPool({ host: 'mydb.com', user:'myUser' });
pool.on('connection', (conn) => console.log(`connection ${conn.threadId} has been created in pool`);

Is there an issue with me or the module?

@rusher
Copy link
Collaborator

rusher commented Nov 18, 2019

Right, Connector TypeScript definition is missing those pool event.

This will be corrected in next version with 34b3bbd

@rusher
Copy link
Collaborator

rusher commented Dec 2, 2019

released in 2.1.4

@rusher rusher closed this as completed Dec 2, 2019
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