Skip to content

Commit

Permalink
CB2-11778: Fix critical dependency on mysql2 package (#91)
Browse files Browse the repository at this point in the history
* feat(cb2-11778): add explicit charset to mysql connection

* feat(cb2-11778): additional lint change

* feat(cb2-11778): update evl query following database change
  • Loading branch information
LGin-BJSS authored May 31, 2024
1 parent d6e46f5 commit a4b231a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
26 changes: 16 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"aws-lambda": "1.0.6",
"express": "4.18.2",
"moment": "2.29.4",
"mysql2": "3.9.7",
"mysql2": "3.9.8",
"serverless-http": "2.6.0",
"source-map-support": "0.5.19",
"winston": "^3.7.2",
Expand Down
10 changes: 1 addition & 9 deletions src/app/queries/evlQuery.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
const EVL_QUERY = `
SET @prev := '';
SELECT testExpiryDate, vrm_trm, certificateNumber
FROM (
SELECT testExpiryDate, vrm_trm, certificateNumber, IF(@prev <> vrm_trm, @rn:=0,@rn) AS row_number_over_partition, @prev:=vrm_trm, @rn:=@rn+1 AS rn
FROM evl_view
) as SubQ
WHERE row_number_over_partition = 0
`;
const EVL_QUERY = `SELECT testExpiryDate, vrm_trm, certificateNumber FROM evl_view`;

const EVL_VRM_QUERY = `${EVL_QUERY} AND vrm_trm = ?;`;

Expand Down

0 comments on commit a4b231a

Please sign in to comment.