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

torand / FasterSQL / 15071216480

16 May 2025 02:49PM UTC coverage: 69.877% (+2.4%) from 67.475%
15071216480

push

github

web-flow
Merge pull request #30 from torand/access-support

Access support

229 of 414 branches covered (55.31%)

Branch coverage included in aggregate %.

105 of 152 new or added lines in 26 files covered. (69.08%)

3 existing lines in 3 files now uncovered.

1193 of 1621 relevant lines covered (73.6%)

3.92 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/statement/PreparableStatement.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.statement;
17

18
import io.github.torand.fastersql.Column;
19
import io.github.torand.fastersql.Context;
20
import io.github.torand.fastersql.Sql;
21
import io.github.torand.fastersql.alias.ColumnAlias;
22
import io.github.torand.fastersql.dialect.Dialect;
23

24
import java.util.Objects;
25
import java.util.stream.Stream;
26

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

31
/**
32
 * Defines a statement that can be formatted as SQL.
33
 */
34
public interface PreparableStatement extends Sql {
35

36
    @Override
37
    default Stream<Column> columnRefs() {
NEW
38
        return Stream.empty();
×
39
    }
40

41
    @Override
42
    default Stream<ColumnAlias> aliasRefs() {
NEW
43
        return Stream.empty();
×
44
    }
45

46
    /**
47
     * Gets the SQL of specified dialect for this statement.
48
     * @param dialect the SQL dialect.
49
     * @return the SQL statement.
50
     */
51
    default String toString(Dialect dialect) {
UNCOV
52
        Context context = Context.of(dialect);
×
53

54
        String stringifiedParams = streamSafely(params(context))
×
55
            .map(Objects::toString)
×
56
            .collect(joining(", "));
×
57

58
        return sql(context) + (isBlank(stringifiedParams) ? " with no params" : " with params " + stringifiedParams);
×
59
    }
60
}
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