@appland/scanner 1.81.1 → 1.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # [@appland/scanner-v1.82.0](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.81.1...@appland/scanner-v1.82.0) (2023-08-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fix caching of unparseable SQL ([e81db08](https://github.com/getappmap/appmap-js/commit/e81db08d6f6a7b661f77aa3aead5e800e15a7358))
7
+
8
+
9
+ ### Features
10
+
11
+ * Analyze in worker threads ([612da06](https://github.com/getappmap/appmap-js/commit/612da06532e765469094aaeaaf614a52e75e46d2))
12
+
1
13
  # [@appland/scanner-v1.81.1](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.81.0...@appland/scanner-v1.81.1) (2023-08-11)
2
14
 
3
15
 
@@ -15,12 +15,19 @@ class AppMapIndex {
15
15
  if (!event.sql)
16
16
  throw new Error(`${event.fqid} is not a SQL query`);
17
17
  const sql = this.sqlNormalized(event);
18
- let ast = ASTBySQLString.get(sql);
19
- if (!ast) {
20
- ast = (0, models_1.parseSQL)(sql);
21
- ast ? ASTBySQLString.set(sql, ast) : ASTBySQLString.set(sql, null);
18
+ let result;
19
+ const cachedAST = ASTBySQLString.get(sql);
20
+ if (cachedAST === 'parse-error') {
21
+ result = undefined;
22
22
  }
23
- return ast;
23
+ else if (cachedAST) {
24
+ result = cachedAST;
25
+ }
26
+ else {
27
+ result = (0, models_1.parseSQL)(sql);
28
+ ASTBySQLString.set(sql, result ? result : 'parse-error');
29
+ }
30
+ return result;
24
31
  }
25
32
  sqlNormalized(event) {
26
33
  if (!event.sql)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appland/scanner",
3
- "version": "1.81.1",
3
+ "version": "1.82.0",
4
4
  "description": "Analyze AppMaps for code flaws",
5
5
  "bin": "built/cli.js",
6
6
  "main": "built/index.js",