Skip to content

feat: Add SQL database queries to agent CLI - #389

Open
Oliver-Zimmerman wants to merge 1 commit into
mainfrom
audit/sql-query-20260817
Open

feat: Add SQL database queries to agent CLI#389
Oliver-Zimmerman wants to merge 1 commit into
mainfrom
audit/sql-query-20260817

Conversation

@Oliver-Zimmerman

Copy link
Copy Markdown
Collaborator

Audit finding

Telnyx CLI v0.27.0 added storage:sqldbs:actions query, but the agent CLI had no wrapper for stateful SQL access.

Scope

  • add storage-sql-query --id --sql
  • support repeatable bound parameters and preserve execution metadata
  • update README, help, capabilities, version guard, and mock-binary tests

Depends on the bundled v0.27.0 upgrade in #379.

Validation

  • storage SQL tests: 5/5 passed
  • related integration/unknown-flag tests: 14/14 passed
  • npx tsc --noEmit passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c27142a45b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

try {
const response = await telnyxCli(args, { minimumVersion: MINIMUM_CLI_VERSION });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Bundle the Go CLI version required by SQL queries

On a standard npm installation without a separately installed telnyx binary, scripts/postinstall.ts still downloads the v0.24.0 pin from src/platform-release.ts, but this minimum-version guard rejects it and then attempts a PATH fallback. Consequently, the newly advertised command fails before executing any query for the package's normal installation path; bundle v0.27.0 or keep this command unavailable until that pin lands.

AGENTS.md reference: AGENTS.md:L116-L123

Useful? React with 👍 / 👎.

): Promise<void> {
const jsonOutput = flags.json === true;
const databaseId = requiredString(flags, "id", "SQL database ID", jsonOutput);
const sql = requiredString(flags, "sql", "SQL query or statement", jsonOutput);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept SQL scripts that start with a line comment

When --sql is followed by a statement beginning with --—for example, a generated migration script starting with -- create tablesparseFlags treats the statement as another flag because it refuses to consume values beginning with --. As a result, flags.sql becomes boolean true and this required-field check rejects an otherwise valid SQL script; add a parsing form that can preserve such values, such as command-specific consumption or --sql=... support.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant