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

torand / FasterSQL / 15294773771

28 May 2025 08:01AM UTC coverage: 70.078% (+0.2%) from 69.877%
15294773771

Pull #31

github

web-flow
Merge 9f1c324c0 into 6be86da23
Pull Request #31: feat: add support for SQLite dialect

233 of 418 branches covered (55.74%)

Branch coverage included in aggregate %.

28 of 33 new or added lines in 12 files covered. (84.85%)

45 existing lines in 10 files now uncovered.

1212 of 1644 relevant lines covered (73.72%)

3.91 hits per line

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

85.71
/src/main/java/io/github/torand/fastersql/dialect/AccessDialect.java
1
/*
2
 * Copyright (c) 2024-2025 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.dialect;
17

18
import java.util.EnumSet;
19
import java.util.List;
20
import java.util.Optional;
21

22
import static io.github.torand.fastersql.dialect.Capability.CONCAT_OPERATOR;
23
import static io.github.torand.fastersql.dialect.Capability.LIMIT_OFFSET;
24
import static io.github.torand.fastersql.dialect.Capability.SELECT_FOR_UPDATE;
25
import static io.github.torand.fastersql.dialect.Capability.TRUNCATE_TABLE;
26

27
/**
28
 * Defines the Access dialect.
29
 *
30
 * <a href="https://support.microsoft.com/en-us/office/Queries-93fb69b7-cfc1-4f3e-ab56-b0a01523bb50#ID0EAABAAA=SQL_syntax&id0ebbd=sql_syntax" />
31
 */
32
public class AccessDialect implements Dialect {
33
    private final EnumSet<Capability> supportedCaps;
34

35
    public AccessDialect() {
36
        this(EnumSet.of(LIMIT_OFFSET, SELECT_FOR_UPDATE, CONCAT_OPERATOR, TRUNCATE_TABLE));
7✔
37
    }
1✔
38

39
    private AccessDialect(EnumSet<Capability> capabilities) {
2✔
40
        this.supportedCaps = EnumSet.copyOf(capabilities);
4✔
41
    }
1✔
42

43
    @Override
44
    public String getProductName() {
45
        return "Access";
2✔
46
    }
47

48
    @Override
49
    public boolean offsetBeforeLimit() {
50
        return true;
2✔
51
    }
52

53
    @Override
54
    public Optional<String> formatRowOffsetClause() {
55
        return Optional.of("offset ? rows");
3✔
56
    }
57

58
    @Override
59
    public Optional<String> formatRowLimitClause() {
60
        return Optional.of("fetch next ? rows only");
3✔
61
    }
62

63
    @Override
64
    public Optional<String> formatRowNumLiteral() {
UNCOV
65
        return Optional.empty();
×
66
    }
67

68
    @Override
69
    public String formatToNumberFunction(String operand, int precision, int scale) {
70
        return "val(" + operand + ")";
3✔
71
    }
72

73
    @Override
74
    public String formatToCharFunction(String operand, String format) {
UNCOV
75
        throw new UnsupportedOperationException("Access does not support the to_char() function");
×
76
    }
77

78
    @Override
79
    public String formatSubstringFunction(String operand, int startPos, int length) {
80
        return "substring(" + operand + ", " + startPos + ", " + length + ")";
5✔
81
    }
82

83
    @Override
84
    public String formatConcatFunction(List<String> operands) {
UNCOV
85
        throw new UnsupportedOperationException("Access does not support the concat() function (use the concat infix operator instead)");
×
86
    }
87

88
    @Override
89
    public String formatLengthFunction(String operand) {
90
        return "len(" + operand + ")";
3✔
91
    }
92

93
    @Override
94
    public String formatCeilFunction(String operand) {
95
        return "ceil(" + operand + ")";
3✔
96
    }
97

98
    @Override
99
    public String formatRoundFunction(String operand) {
100
        return "round(" + operand + ", 0)";
3✔
101
    }
102

103
    @Override
104
    public String formatModuloFunction(String divisor, String dividend) {
105
        return "mod(" + divisor + ", " + dividend + ")";
4✔
106
    }
107

108
    @Override
109
    public String formatCurrentDateFunction() {
110
        return "current_date";
2✔
111
    }
112

113
    @Override
114
    public Optional<String> getConcatOperator() {
115
        return Optional.of("&");
3✔
116
    }
117

118
    @Override
119
    public boolean supports(Capability capability) {
120
        return supportedCaps.contains(capability);
5✔
121
    }
122
}
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