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

typeorm / typeorm / 15219332477

23 May 2025 09:13PM UTC coverage: 17.216% (-59.1%) from 76.346%
15219332477

Pull #11332

github

naorpeled
cr comments - move if block
Pull Request #11332: feat: add new undefined and null behavior flags

1603 of 12759 branches covered (12.56%)

Branch coverage included in aggregate %.

0 of 31 new or added lines in 3 files covered. (0.0%)

14132 existing lines in 166 files now uncovered.

4731 of 24033 relevant lines covered (19.69%)

60.22 hits per line

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

33.33
/src/find-options/operator/Raw.ts
1
import { FindOperator } from "../FindOperator"
1✔
2
import { ObjectLiteral } from "../../common/ObjectLiteral"
3

4
/**
5
 * Find Options Operator.
6
 * Example: { someField: Raw("12") }
7
 */
8
export function Raw<T>(value: string): FindOperator<any>
9

10
/**
11
 * Find Options Operator.
12
 * Example: { someField: Raw((columnAlias) => `${columnAlias} = 5`) }
13
 */
14
export function Raw<T>(
15
    sqlGenerator: (columnAlias: string) => string,
16
): FindOperator<any>
17

18
/**
19
 * Find Options Operator.
20
 * For escaping parameters use next syntax:
21
 * Example: { someField: Raw((columnAlias) => `${columnAlias} = :value`, { value: 5 }) }
22
 */
23
export function Raw<T>(
24
    sqlGenerator: (columnAlias: string) => string,
25
    parameters: ObjectLiteral,
26
): FindOperator<any>
27

28
export function Raw<T>(
1✔
29
    valueOrSqlGenerator: string | ((columnAlias: string) => string),
30
    sqlGeneratorParameters?: ObjectLiteral,
31
): FindOperator<any> {
UNCOV
32
    if (typeof valueOrSqlGenerator !== "function") {
×
UNCOV
33
        return new FindOperator("raw", valueOrSqlGenerator, false)
×
34
    }
35

UNCOV
36
    return new FindOperator(
×
37
        "raw",
38
        [],
39
        true,
40
        true,
41
        valueOrSqlGenerator,
42
        sqlGeneratorParameters,
43
    )
44
}
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

© 2025 Coveralls, Inc