feat: Add SQL database queries to agent CLI - #389
Conversation
There was a problem hiding this comment.
💡 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 }); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 tables—parseFlags 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 👍 / 👎.
Audit finding
Telnyx CLI v0.27.0 added
storage:sqldbs:actions query, but the agent CLI had no wrapper for stateful SQL access.Scope
storage-sql-query --id --sqlDepends on the bundled v0.27.0 upgrade in #379.
Validation
npx tsc --noEmitpassed