Skip to content

chore: update SQL syntax formatting to use string text block - #4012

Merged
robfrank merged 1 commit into
mainfrom
chore/code-upgrade
Apr 28, 2026
Merged

chore: update SQL syntax formatting to use string text block#4012
robfrank merged 1 commit into
mainfrom
chore/code-upgrade

Conversation

@robfrank

Copy link
Copy Markdown
Collaborator

No description provided.

@robfrank
robfrank merged commit e50d5fd into main Apr 28, 2026
7 of 11 checks passed
@codacy-production

codacy-production Bot commented Apr 28, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 Coverage 66.67% diff coverage · -7.87% coverage variation

Metric Results
Coverage variation -7.87% coverage variation
Diff coverage 66.67% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e4d09dd) 120069 87800 73.12%
Head commit (3125b83) 151308 (+31239) 98739 (+10939) 65.26% (-7.87%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4012) 12 8 66.67%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@claude

claude Bot commented Apr 28, 2026

Copy link
Copy Markdown

Code Review: PR 4012 - chore: update SQL syntax formatting to use string text blocks

Status: MERGED - Retrospective review.

Overview

This PR converts approximately 400 sites of multi-line string concatenation to Java text blocks across the entire codebase. It touches log messages, exception messages, SQL/Cypher queries in tests, configuration descriptions, and benchmark report format strings.

What Works Well

Correct use of line continuation: The vast majority of conversions correctly use the line-continuation escape at the end of content lines to suppress the implicit newline that text blocks would otherwise insert. This is the right technique for single-logical-line strings that were previously concatenated only for line-length reasons.

Report format strings: The String.format patterns that previously used newline-prefix chaining are correctly converted. A leading blank line inside the text block maps exactly to the opening newline, so the formatted output is identical.

Intentionally multi-line strings: ConsoleBatchTest.java and LineProtocolParserTest.java correctly drop line continuations where actual newlines are desired. The ConsoleBatchTest.java change is a net improvement - the original had an inconsistent mix of line-suppression and the space-escape inside the same text block. The new version is uniform and cleaner.

Issues and Observations

1. Redundant trailing line-continuation in AlgoAllSimplePaths.java

The last content line uses a line-continuation escape before the closing delimiter, which sits on its own indented line. When the closing delimiter is on its own indented line at the same level as the content, the trailing newline is already stripped by the re-indentation algorithm. Not a bug, but a style inconsistency with the rest of the PR.

2. Awkward mid-token line split in CountEdgesOptimizationTest.java

A property access is split at the dot: identifier q on one line, .name AS name on the next, joined by a line-continuation escape. This was forced by the 160-char limit in the original concatenated form. With text blocks content lines are not constrained to that limit, so the split could be moved to a word boundary for clarity.

3. Leading-space SQL continuation keywords (subtle)

In FullTextPolymorphicScoreTest.java, continuation lines for WHERE and LIMIT carry a single leading space. This is intentional and correct - it matches the original concatenation pattern where each continuation string started with a space. The single leading space is visually easy to miss; future editors should be careful not to strip it accidentally.

Correctness Assessment

Semantic equivalence was verified across all patterns. Single-line strings (SQL, Cypher, log messages, exceptions): line-continuation escapes preserve original content including trailing spaces before keywords. Multi-line strings (batch commands, line protocol test data): natural newlines produce the correct multi-line output. String.format patterns with embedded newlines: leading blank lines in text blocks correctly represent opening newlines. No behavioral regressions introduced.

Summary

A clean, well-executed chore. Java text blocks (stable since Java 15, fully supported on this project Java 21+ baseline) are applied correctly throughout with only minor style inconsistencies. The readability improvement is substantial, especially for multi-line SQL and Cypher queries in tests. Two small recommendations for future similar PRs: avoid mid-token line splits when content can be reformatted to put the split at a word boundary, and remove redundant line-continuation escapes before indented closing delimiters.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors various string concatenations and multi-line strings across the codebase into Java text blocks for improved readability. Several instances were identified where trailing backslashes in text blocks were incorrectly placed, which would cause compilation errors. The feedback provided addresses these syntax issues by suggesting the removal of the trailing backslashes and, in one case, restoring a missing newline character.

+ "optionally excluding relationship types via { skipRelTypes: [...] }";
return """
Find all simple paths (without repeated nodes) between two nodes up to a maximum depth, \
optionally excluding relationship types via { skipRelTypes: [...] }\

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The trailing backslash \ on the last line of the text block is a syntax error and will cause a compilation failure. According to the Java text block specification, a backslash cannot be the last character before the closing delimiter. Please remove it.

Suggested change
optionally excluding relationship types via { skipRelTypes: [...] }\
optionally excluding relationship types via { skipRelTypes: [...] }

"UPDATE Doc SET b = 3 WHERE @rid = $x.@rid[0];");
"""
LET $x = INSERT INTO Doc RETURN @rid;
UPDATE Doc SET b = 3 WHERE @rid = $x.@rid[0];\

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The trailing backslash \ on the last line of the text block is a syntax error and will cause a compilation failure. According to the Java text block specification, a backslash cannot be the last character before the closing delimiter. Please remove it.

Suggested change
UPDATE Doc SET b = 3 WHERE @rid = $x.@rid[0];\
UPDATE Doc SET b = 3 WHERE @rid = $x.@rid[0];

"UPDATE $x.@rid[0] SET b = 3;");
"""
LET $x = INSERT INTO Doc RETURN @rid;
UPDATE $x.@rid[0] SET b = 3;\

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The trailing backslash \ on the last line of the text block is a syntax error and will cause a compilation failure. According to the Java text block specification, a backslash cannot be the last character before the closing delimiter. Please remove it.

Suggested change
UPDATE $x.@rid[0] SET b = 3;\
UPDATE $x.@rid[0] SET b = 3;

"DELETE FROM $x;");
"""
LET $x = SELECT @rid FROM Doc;
DELETE FROM $x;\

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The trailing backslash \ on the last line of the text block is a syntax error and will cause a compilation failure. According to the Java text block specification, a backslash cannot be the last character before the closing delimiter. Please remove it.

Suggested change
DELETE FROM $x;\
DELETE FROM $x;

+ "vertex,Person,t1,\"Alice, Jr.\",\"She said \"\"hello\"\"\"\n";
final String input = """
@type,@class,@id,name,description
vertex,Person,t1,"Alice, Jr.","She said ""hello""\"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The trailing backslash \ is a syntax error and will cause a compilation failure. It should be removed. The original string also had a trailing newline, which is now missing. To preserve the original behavior, please add a newline before the closing delimiter.

Suggested change
vertex,Person,t1,"Alice, Jr.","She said ""hello""\"
vertex,Person,t1,"Alice, Jr.","She said ""hello"""

@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.21%. Comparing base (e4d09dd) to head (3125b83).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...om/arcadedb/schema/ContinuousAggregateBuilder.java 25.00% 3 Missing ⚠️
...opencypher/procedures/algo/AlgoAllSimplePaths.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4012   +/-   ##
=======================================
  Coverage   64.20%   64.21%           
=======================================
  Files        1597     1597           
  Lines      120069   120069           
  Branches    25557    25557           
=======================================
+ Hits        77096    77108   +12     
+ Misses      32299    32288   -11     
+ Partials    10674    10673    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

robfrank added a commit that referenced this pull request May 12, 2026
tae898 pushed a commit to humemai/arcadedb-embedded-python that referenced this pull request Jun 28, 2026
@lvca
lvca deleted the chore/code-upgrade branch July 3, 2026 20:18
mergify Bot added a commit that referenced this pull request Jul 26, 2026
…o [skip ci]

Bumps [marked](https://github.com/markedjs/marked) from 18.0.6 to 18.0.7.
Release notes

*Sourced from [marked's releases](https://github.com/markedjs/marked/releases).*

> v18.0.7
> -------
>
> [18.0.7](markedjs/marked@v18.0.6...v18.0.7) (2026-07-21)
> -----------------------------------------------------------------------------------
>
> ### Bug Fixes
>
> * Avoid O(n^2) backtracking in HTML block close and tilde interrupt regexes ([#4014](https://redirect.github.com/markedjs/marked/issues/4014)) ([f945fc5](markedjs/marked@f945fc5)), closes [#3991](https://redirect.github.com/markedjs/marked/issues/3991)
> * Avoid O(n^2) masked source rebuild in inline tokenizer ([#4017](https://redirect.github.com/markedjs/marked/issues/4017)) ([9154f8f](markedjs/marked@9154f8f))
> * keep empty list after blockquote as a sibling block ([#4004](https://redirect.github.com/markedjs/marked/issues/4004)) ([3f144a0](markedjs/marked@3f144a0))
> * preserve code spans adjacent to tildes ([#4012](https://redirect.github.com/markedjs/marked/issues/4012)) ([0de7188](markedjs/marked@0de7188))
> * Recognize setext headings whose first line starts with # ([#4015](https://redirect.github.com/markedjs/marked/issues/4015)) ([f056437](markedjs/marked@f056437)), closes [#1](https://redirect.github.com/markedjs/marked/issues/1)
> * treat a line of only tabs as a blank line between paragraphs ([#4007](https://redirect.github.com/markedjs/marked/issues/4007)) ([bc2f121](markedjs/marked@bc2f121))


Commits

* [`a8971a1`](markedjs/marked@a8971a1) chore(release): 18.0.7 [skip ci]
* [`d899c2e`](markedjs/marked@d899c2e) chore(deps): bump actions/setup-node from 6 to 7 ([#4025](https://redirect.github.com/markedjs/marked/issues/4025))
* [`7fbf82e`](markedjs/marked@7fbf82e) chore(deps-dev): bump semantic-release from 25.0.7 to 25.0.8 ([#4026](https://redirect.github.com/markedjs/marked/issues/4026))
* [`738edf2`](markedjs/marked@738edf2) chore(deps-dev): bump brace-expansion from 5.0.2 to 5.0.6 ([#4027](https://redirect.github.com/markedjs/marked/issues/4027))
* [`9154f8f`](markedjs/marked@9154f8f) fix: Avoid O(n^2) masked source rebuild in inline tokenizer ([#4017](https://redirect.github.com/markedjs/marked/issues/4017))
* [`f945fc5`](markedjs/marked@f945fc5) fix: Avoid O(n^2) backtracking in HTML block close and tilde interrupt regexe...
* [`3f144a0`](markedjs/marked@3f144a0) fix: keep empty list after blockquote as a sibling block ([#4004](https://redirect.github.com/markedjs/marked/issues/4004))
* [`0de7188`](markedjs/marked@0de7188) fix: preserve code spans adjacent to tildes ([#4012](https://redirect.github.com/markedjs/marked/issues/4012))
* [`f056437`](markedjs/marked@f056437) fix: Recognize setext headings whose first line starts with # ([#4015](https://redirect.github.com/markedjs/marked/issues/4015))
* [`12bfa94`](markedjs/marked@12bfa94) chore(deps-dev): bump semantic-release from 25.0.5 to 25.0.7 ([#4020](https://redirect.github.com/markedjs/marked/issues/4020))
* Additional commits viewable in [compare view](markedjs/marked@v18.0.6...v18.0.7)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=marked&package-manager=npm\_and\_yarn&previous-version=18.0.6&new-version=18.0.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant