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

torand / FasterSQL / 13432247935

20 Feb 2025 09:38AM UTC coverage: 61.863% (-0.5%) from 62.338%
13432247935

push

github

torand
feat: add ANSI/ISO SQL dialect

168 of 350 branches covered (48.0%)

Branch coverage included in aggregate %.

0 of 14 new or added lines in 2 files covered. (0.0%)

888 of 1357 relevant lines covered (65.44%)

3.46 hits per line

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

11.11
/src/main/java/io/github/torand/fastersql/statement/PreparableStatement.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.statement;
17

18
import io.github.torand.fastersql.Context;
19
import io.github.torand.fastersql.dialect.AnsiIsoDialect;
20
import io.github.torand.fastersql.dialect.Dialect;
21

22
import java.util.List;
23
import java.util.Objects;
24

25
import static io.github.torand.fastersql.util.collection.CollectionHelper.streamSafely;
26
import static io.github.torand.fastersql.util.lang.StringHelper.isBlank;
27
import static java.util.stream.Collectors.joining;
28

29
public abstract class PreparableStatement {
3✔
30
    abstract String sql(Context context);
31
    abstract List<Object> params(Context context);
32

33
    public String toString(Dialect dialect) {
34
        Context context = Context.of(dialect);
×
35

36
        String stringifiedParams = streamSafely(params(context))
×
37
            .map(Objects::toString)
×
38
            .collect(joining(", "));
×
39

40
        return sql(context) + (isBlank(stringifiedParams) ? " with no params" : " with params " + stringifiedParams);
×
41
    }
42

43
    @Override
44
    public String toString() {
NEW
45
        return toString(new AnsiIsoDialect());
×
46
    }
47
}
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