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

torand / FasterSQL / 13367709795

17 Feb 2025 10:06AM UTC coverage: 58.785% (+2.0%) from 56.762%
13367709795

push

github

torand
feat: support length function

148 of 338 branches covered (43.79%)

Branch coverage included in aggregate %.

10 of 17 new or added lines in 7 files covered. (58.82%)

66 existing lines in 9 files now uncovered.

829 of 1324 relevant lines covered (62.61%)

3.33 hits per line

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

80.0
/src/main/java/io/github/torand/fastersql/function/singlerow/SingleRowFunctions.java
1
/*
2
 * Copyright (c) 2024 Tore Eide Andersen
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package io.github.torand.fastersql.function.singlerow;
17

18
import io.github.torand.fastersql.expression.Expression;
19

20
import java.util.ArrayList;
21
import java.util.List;
22

23
import static java.util.Objects.nonNull;
24
import static java.util.Objects.requireNonNull;
25

26
public final class SingleRowFunctions {
27
    private SingleRowFunctions() {}
28

29
    public static Upper upper(Expression expression) {
30
        return new Upper(expression, null);
6✔
31
    }
32

33
    public static Lower lower(Expression expression) {
34
        return new Lower(expression, null);
6✔
35
    }
36

37
    public static ToNumber to_number(Expression expression, int precision, int scale) {
UNCOV
38
        return new ToNumber(expression, precision, scale, null);
×
39
    }
40

41
    public static ToNumber to_number(Expression expression, int precision) {
UNCOV
42
        return new ToNumber(expression, precision, 0, null);
×
43
    }
44

45
    public static Substring substring(Expression expression, int startPos, int length) {
46
        return new Substring(expression, startPos, length, null);
8✔
47
    }
48

49
    public static ToChar toChar(Expression expression, String format) {
50
        return new ToChar(expression, format, null);
7✔
51
    }
52

53
    public static Concat concat(Expression expression1, Expression expression2, Expression... otherExpressions) {
54
        List<Expression> expressions = new ArrayList<>();
4✔
55
        expressions.add(requireNonNull(expression1, "First expression is null"));
7✔
56
        expressions.add(requireNonNull(expression2, "Second expression is null"));
7✔
57
        if (nonNull(otherExpressions)) {
3!
58
            expressions.addAll(List.of(otherExpressions));
5✔
59
        }
60

61
        return new Concat(expressions, null);
6✔
62
    }
63

64
    public static Length length(Expression expression) {
65
        return new Length(expression, null);
6✔
66
    }
67
}
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