• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vzakharchenko / forge-sql-orm / 17807157011

17 Sep 2025 06:30PM UTC coverage: 87.32% (+0.04%) from 87.284%
17807157011

push

github

vzakharchenko
improved logging

460 of 555 branches covered (82.88%)

Branch coverage included in aggregate %.

45 of 62 new or added lines in 9 files covered. (72.58%)

1 existing line in 1 file now uncovered.

2026 of 2292 relevant lines covered (88.39%)

14.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.71
/src/utils/forgeDriverProxy.ts
1
import { forgeDriver } from "./forgeDriver";
1✔
2
import { injectSqlHints, SqlHints } from "./sqlHints";
1✔
3

4
/**
5
 * Creates a proxy for the forgeDriver that injects SQL hints
6
 * @returns A proxied version of the forgeDriver
7
 */
8
export function createForgeDriverProxy(options?: SqlHints, logRawSqlQuery?: boolean) {
1✔
9
  return async (
3✔
10
    query: string,
72✔
11
    params: any[],
72✔
12
    method: "all" | "execute",
72✔
13
  ): Promise<{
14
    rows: any[];
15
    insertId?: number;
16
    affectedRows?: number;
17
  }> => {
72✔
18
    // Inject SQL hints into the query
19
    const modifiedQuery = injectSqlHints(query, options);
72✔
20

21
    if (options && logRawSqlQuery && modifiedQuery !== query) {
72!
NEW
22
      console.debug("injected Hints: " + modifiedQuery);
×
NEW
23
    }
×
24
    try {
72✔
25
      // Call the original forgeDriver with the modified query
26
      return forgeDriver(modifiedQuery, params, method);
72✔
27
    } catch (error) {
72!
NEW
28
      if (logRawSqlQuery) {
×
NEW
29
        console.debug("SQL Error:", JSON.stringify(error));
×
NEW
30
      }
×
NEW
31
      throw error;
×
UNCOV
32
    }
×
33
  };
72✔
34
}
3✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc