Skip to content

[codex] add JSON support to query sssql refresh#699

Merged
mk3008 merged 1 commit intomainfrom
codex/632-sssql-scaffold-refresh
Apr 2, 2026
Merged

[codex] add JSON support to query sssql refresh#699
mk3008 merged 1 commit intomainfrom
codex/632-sssql-scaffold-refresh

Conversation

@mk3008
Copy link
Copy Markdown
Owner

@mk3008 mk3008 commented Apr 2, 2026

What changed

  • Added --json support to ztd query sssql refresh so it matches the scaffold command's machine-readable option style.
  • Added a CLI test that covers JSON payload parsing and JSON envelope output for refresh.

Why

Impact

  • Users can now drive ztd query sssql refresh through JSON payloads in the same way as scaffold.
  • Existing refresh behavior is unchanged when --json is not used.

Checks

  • pnpm test -- packages/core/tests/transformers/SSSQLFilterBuilder.test.ts
  • pnpm --filter @rawsql-ts/ztd-cli exec vitest run --config vitest.config.ts tests/cliCommands.test.ts -t "query sssql"

Summary by CodeRabbit

New Features

  • The query sssql refresh command now accepts a --json option with a JSON payload for specifying output destination and format.

Tests

  • Added test coverage for JSON payload handling in the query sssql refresh command.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5dc19974-d536-4a3a-a335-5e66161477d9

📥 Commits

Reviewing files that changed from the base of the PR and between 64b78c4 and 2d082a0.

📒 Files selected for processing (2)
  • packages/ztd-cli/src/commands/query.ts
  • packages/ztd-cli/tests/cliCommands.test.ts

📝 Walkthrough

Walkthrough

The changes add JSON payload support to the query sssql refresh command via a new --json <payload> CLI option. The implementation parses the JSON payload and merges it into command options for output configuration, with corresponding test coverage added.

Changes

Cohort / File(s) Summary
JSON Payload Option Support
packages/ztd-cli/src/commands/query.ts
Added json?: string field to QuerySssqlRefreshOptions and --json <payload> CLI option. Updated command handler to parse JSON via parseJsonPayload and merge into resolved options for out and format configuration.
Test Coverage
packages/ztd-cli/tests/cliCommands.test.ts
Reformatted existing test and added new test case validating JSON payload acceptance in query sssql refresh, verifying structured JSON response output and generated SQL correctness.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A JSON path appeared one day,
Through --json flags the options play,
Merge and parse with rhythmic flow,
Machine-readable, don't you know!
Tests confirm our new delight,
The refresh command now shines bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding JSON support to the query sssql refresh command, which is clearly reflected in the file modifications and test additions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/632-sssql-scaffold-refresh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mk3008 mk3008 marked this pull request as ready for review April 2, 2026 10:11
@mk3008 mk3008 merged commit a52d39d into main Apr 2, 2026
9 checks passed
@mk3008 mk3008 deleted the codex/632-sssql-scaffold-refresh branch April 2, 2026 12:06
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