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

torand / FasterSQL / 13393719904

18 Feb 2025 03:08PM UTC coverage: 60.439% (+0.5%) from 59.964%
13393719904

push

github

torand
test: MySQL specific testing of insert clause

160 of 346 branches covered (46.24%)

Branch coverage included in aggregate %.

4 of 11 new or added lines in 6 files covered. (36.36%)

859 of 1340 relevant lines covered (64.1%)

3.4 hits per line

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

0.0
/src/main/java/io/github/torand/fastersql/dialect/MariaDbDialect.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.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

25
public class MariaDbDialect implements Dialect {
×
26
    private static final EnumSet<Capability> SUPPORTED_CAPS = EnumSet.of(LIMIT_OFFSET, CONCAT_OPERATOR);
×
27

28
    @Override
29
    public String getProductName() {
30
        return "MariaDB";
×
31
    }
32

33
    @Override
34
    public boolean offsetBeforeLimit() {
35
        return true;
×
36
    }
37

38
    @Override
39
    public Optional<String> formatRowOffsetClause() {
40
        return Optional.of("offset ?");
×
41
    }
42

43
    @Override
44
    public Optional<String> formatRowLimitClause() {
45
        return Optional.of("limit ?");
×
46
    }
47

48
    @Override
49
    public Optional<String> formatRowNumLiteral() {
50
        return Optional.empty();
×
51
    }
52

53
    @Override
54
    public String formatToNumberFunction(String operand, int precision, int scale) {
55
        return "cast(" + operand + " as decimal(" + precision + "," + scale + "))";
×
56
    }
57

58
    @Override
59
    public String formatToCharFunction(String operand, String format) {
NEW
60
        throw new UnsupportedOperationException("MariaDb does not support the to_char() function");
×
61
    }
62

63
    @Override
64
    public String formatSubstringFunction(String operand, int startPos, int length) {
65
        return "substring(" + operand + ", " + startPos + ", " + length + ")";
×
66
    }
67

68
    @Override
69
    public String formatConcatFunction(List<String> operands) {
NEW
70
        throw new UnsupportedOperationException("MariaDb does not support the concat() function (use the concat infix operator instead)");
×
71
    }
72

73
    @Override
74
    public String formatLengthFunction(String operand) {
75
        return "char_length(" + operand + ")";
×
76
    }
77

78
    @Override
79
    public boolean supports(Capability capability) {
80
        return SUPPORTED_CAPS.contains(capability);
×
81
    }
82
}
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