-
Notifications
You must be signed in to change notification settings - Fork 0
bugfix/96-render-timestamp-precision #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # virtual-schema-common-lua 5.1.0, released 2026-08-14 | ||
|
|
||
| Code name: Render TIMESTAMP Precision | ||
|
|
||
| ## Summary | ||
|
|
||
| This release preserves the optional fractional-second precision of `TIMESTAMP` type definitions when rendering SQL. | ||
|
|
||
| ## Features | ||
|
|
||
| * #96: Render `TIMESTAMP(p)` and `TIMESTAMP(p) WITH LOCAL TIME ZONE` in `CAST` and `JSON_VALUE ... RETURNING` expressions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # GH-96 Render TIMESTAMP precision | ||
|
|
||
| ## Goal | ||
|
|
||
| Preserve an optional fractional-second precision from a `TIMESTAMP` type definition when VSCL renders SQL. This enables adapters to render `CAST` and `JSON_VALUE ... RETURNING` expressions accurately for both plain timestamps and timestamps with local time zone. | ||
|
|
||
| ## Scope | ||
|
|
||
| In scope: | ||
|
|
||
| * Render `TIMESTAMP(p)` when the type definition supplies a precision from `0` through `9`. | ||
| * Render `TIMESTAMP(p) WITH LOCAL TIME ZONE` when both precision and the local-time-zone modifier are supplied. | ||
| * Keep the existing output for timestamp definitions without precision: `TIMESTAMP` and `TIMESTAMP WITH LOCAL TIME ZONE`. | ||
| * Update the LuaLS timestamp type definition and add focused renderer regression tests. | ||
| * Release the bug fix and document it in the changelog. | ||
|
|
||
| Out of scope: | ||
|
|
||
| * Validate or normalize precision values received from the Virtual Schema API. | ||
| * Change timestamp literals, other SQL data types, or the public query-renderer architecture. | ||
| * Alter the existing requirement or QueryRenderer sequence diagram, whose stated behavior already covers rendering the AST to SQL. | ||
|
|
||
| ## Design References | ||
|
|
||
| * [System Requirements](../system_requirements.md) — `req~render-sql-query~1` | ||
| * [Query Push-down Model](../model/diagrams/sequence/seq_push_down.plantuml) — existing `dsn -> req~render-sql-query~1` coverage | ||
| * [Developer Guide](../developer_guide/developer_guide.md) — test, static-analysis, type-checking, and diagram-build commands | ||
| * [CI Build](../../.github/workflows/ci-build.yml) — required project quality gates | ||
|
|
||
| ## Strategy | ||
|
|
||
| Extend the shared timestamp branch of `AbstractQueryAppender:_append_data_type`. After the existing `TIMESTAMP` token, append the parenthesized precision only when `data_type.precision` is present; append `WITH LOCAL TIME ZONE` afterwards when requested. This preserves both grammar order and current no-precision output for every caller of `_append_data_type`, including `CAST` and `JSON_VALUE`. | ||
|
|
||
| No traced requirement or design change is planned: GH-96 corrects incomplete handling within the already-traced SQL-rendering requirement. The repository does not contain the expected `doc/design/quality_requirements.md`; therefore this plan derives verification from the checked-in developer guide, trace script, and CI workflow. | ||
|
|
||
| ## Task List | ||
|
|
||
| - [x] Create and checkout a new Git branch `bugfix/96-render-timestamp-precision`. | ||
|
|
||
| ### Requirements And Design | ||
|
|
||
| - [x] Confirm that `req~render-sql-query~1` remains semantically accurate and keep its current revision and existing `dsn -> req~render-sql-query~1` forwarding unchanged. | ||
| - [x] No requirement or QueryRenderer sequence-diagram review was necessary; implementation remained within the existing behavior. | ||
|
|
||
| ### Implementation | ||
|
|
||
| - [x] Add optional `precision: integer?` to `TimestampTypeDefinition` in `src/exasol/vscl/types/type_definition.lua`. | ||
| - [x] Update `AbstractQueryAppender:_append_timestamp` to emit `(<precision>)` before the optional ` WITH LOCAL TIME ZONE` suffix, without changing output when precision is absent. | ||
|
|
||
| ### Verification | ||
|
|
||
| - [x] Add `ScalarFunctionAppender_spec.lua` regression cases for `CAST` rendering plain and local-time-zone timestamp types with explicit boundary precisions (including `0` and `9`) and without precision. | ||
| - [x] Add `ScalarFunctionAppender_spec.lua` regression cases for `JSON_VALUE ... RETURNING` timestamp types with explicit precision, with and without local time zone, and without precision. | ||
| - [x] Run the focused query-renderer specs, then `tools/run_tests.sh --run=ci`, and review the coverage report for the changed appender. | ||
| - [x] Run `tools/run_luacheck.sh` and `tools/run-type-check.sh`. | ||
| - [x] Run `tools/shellcheck.sh`, `tools/build_diagrams.sh`, and `tools/build_docs.sh` as required by the CI build. | ||
| - [x] Keep the OpenFastTrace trace clean with `tools/trace_requirements.sh`. | ||
|
|
||
| ### Update User Documentation | ||
|
|
||
| - [x] Verify that the user and developer guides require no behavioral documentation change; document timestamp precision only in the release notes unless that review finds an existing type-rendering reference to update. | ||
|
|
||
| ## Version and Changelog Update | ||
|
|
||
| - [x] Raise the LuaRocks package version from `5.0.1-1` to `5.1.0-1` as a backward-compatible feature release. | ||
| - [x] Add `doc/changes/changes_5.1.0.md` and link it from `doc/changes/changelog.md`, noting timestamp-precision rendering for `CAST` and `JSON_VALUE`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
virtual-schema-common-lua-5.0.1-1.rockspec → virtual-schema-common-lua-5.1.0-1.rockspec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.