Skip to content

Commit

Permalink
chore: add mysql suffix to callback names
Browse files Browse the repository at this point in the history
  • Loading branch information
rrhodes committed Nov 1, 2024
1 parent 43bba34 commit 86f9ab1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/mysql/test-d/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const connectionMySQL: captureMySQL.PatchedConnection = mysql.createConnection(c
const poolMySQL: captureMySQL.PatchedPool = mysql.createPool(config);
const poolClusterMySQL: captureMySQL.PatchedPoolCluster = mysql.createPoolCluster(config);

const queryCallback: MySQL.queryCallback = function (err: MySQL.MysqlError | null, rows: any) {
const queryCallbackMySQL: MySQL.queryCallback = function (err: MySQL.MysqlError | null, rows: any) {
};

const getConnectionCallback = function (err: MySQL.MysqlError, conn: captureMySQL.PatchedConnection) {
const getConnectionCallbackMySQL = function (err: MySQL.MysqlError, conn: captureMySQL.PatchedConnection) {
};

const connectionMySQL2: captureMySQL.PatchedMySQL2Connection = mysql2.createConnection(config);
Expand All @@ -28,16 +28,16 @@ const poolClusterMySQL2: captureMySQL.PatchedMySQL2PoolCluster = mysql2.createPo

const queryCallbackMySQL2: captureMySQL.MySQL2QueryCallback | undefined = function () { };

expectType<MySQL.Query>(connectionMySQL.query('SELECT * FROM cats', queryCallback));
expectType<MySQL.Query>(connectionMySQL.query('SELECT * FROM cats', queryCallback, segment));
expectType<MySQL.Query>(connectionMySQL.query('SELECT * FROM cats', queryCallbackMySQL));
expectType<MySQL.Query>(connectionMySQL.query('SELECT * FROM cats', queryCallbackMySQL, segment));

expectType<MySQL.Query>(poolMySQL.query('SELECT * FROM cats', queryCallback));
expectType<MySQL.Query>(poolMySQL.query('SELECT * FROM cats', queryCallback, segment));
expectType<void>(poolMySQL.getConnection(getConnectionCallback));
expectType<MySQL.Query>(poolMySQL.query('SELECT * FROM cats', queryCallbackMySQL));
expectType<MySQL.Query>(poolMySQL.query('SELECT * FROM cats', queryCallbackMySQL, segment));
expectType<void>(poolMySQL.getConnection(getConnectionCallbackMySQL));

expectType<void>(poolClusterMySQL.getConnection(getConnectionCallback));
expectType<void>(poolClusterMySQL.getConnection('pattern', getConnectionCallback));
expectType<void>(poolClusterMySQL.getConnection('pattern', 'selector', getConnectionCallback));
expectType<void>(poolClusterMySQL.getConnection(getConnectionCallbackMySQL));
expectType<void>(poolClusterMySQL.getConnection('pattern', getConnectionCallbackMySQL));
expectType<void>(poolClusterMySQL.getConnection('pattern', 'selector', getConnectionCallbackMySQL));

expectType<captureMySQL.PatchedPool>(poolClusterMySQL.of('pattern'));
expectType<captureMySQL.PatchedPool>(poolClusterMySQL.of('pattern', 'selector'));
Expand Down

0 comments on commit 86f9ab1

Please sign in to comment.