Skip to content

Commit

Permalink
ci: add uri test for createPool
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel committed Jun 24, 2023
1 parent 98623dd commit 297d34d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/tsc-build/mysql/baseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const access: mysql.ConnectionOptions = {
database: '',
};

export const uriAccess = `mysql://${access.host}:${access.password}@${access.host}:${access.port}/${access.database}`;

/** The SQL for the query */
export const sql = 'SELECT * FROM `table`';

Expand Down
12 changes: 12 additions & 0 deletions test/tsc-build/mysql/createPool/callbacks/createPool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { mysql } from '../../../index.js';
import { uriAccess, access } from '../../baseConnection.js';

(() => {
let uriPool: mysql.Pool | null = null;
let pool: mysql.Pool | null = null;

if (uriPool === null || pool === null) return;

uriPool = mysql.createPool(uriAccess);
pool = mysql.createPool(access);
})();
2 changes: 2 additions & 0 deletions test/tsc-build/promise/baseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const access: mysql.ConnectionOptions = {
database: '',
};

export const uriAccess = `mysql://${access.host}:${access.password}@${access.host}:${access.port}/${access.database}`;

/** The SQL for the query */
export const sql = 'SELECT * FROM `table`';

Expand Down
12 changes: 12 additions & 0 deletions test/tsc-build/promise/createPool/createPool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { mysqlp as mysql } from '../../index.js';
import { uriAccess, access } from '../baseConnection.js';

(() => {
let uriPool: mysql.Pool | null = null;
let pool: mysql.Pool | null = null;

if (uriPool === null || pool === null) return;

uriPool = mysql.createPool(uriAccess);
pool = mysql.createPool(access);
})();

0 comments on commit 297d34d

Please sign in to comment.