Skip to content

Add Athena support to AWS CLI handler#59

Merged
ldayton merged 4 commits intomainfrom
lily/athena-handler
Jan 22, 2026
Merged

Add Athena support to AWS CLI handler#59
ldayton merged 4 commits intomainfrom
lily/athena-handler

Conversation

@ldayton
Copy link
Copy Markdown
Owner

@ldayton ldayton commented Jan 22, 2026

Summary

  • Add 23 safe Athena commands to SAFE_COMMANDS (list-, get-, batch-get-*)
  • Add SQL analysis to auto-approve read-only start-query-execution queries
  • Read-only keywords: SELECT, SHOW, DESCRIBE, EXPLAIN
  • Write keywords: INSERT, CREATE, ALTER, DROP, TRUNCATE, DELETE, UPDATE, MERGE, MSCK, VACUUM, UNLOAD, GRANT, REVOKE
  • Handles CTEs (WITH ... AS (...) SELECT), comments (-- ..., /* ... */)
  • 107 comprehensive test cases covering all Athena operations

Add 23 safe Athena commands (list-*, get-*, batch-get-*) and 75 test
cases covering all Athena operations. Read operations are auto-approved,
mutations like start-query-execution require confirmation.
Adds SQL analysis to detect read-only queries (SELECT, SHOW, DESCRIBE,
EXPLAIN) vs write operations (INSERT, CREATE, DROP, etc.). Read-only
start-query-execution commands are now auto-approved.

Handles edge cases: CTEs (WITH clauses), comments, multiple CTEs.
Shows (read-only) or (write) suffix in the description so users
understand why a query was approved or needs confirmation.
@ldayton ldayton merged commit 67d42eb into main Jan 22, 2026
1 check passed
@ldayton ldayton deleted the lily/athena-handler branch January 22, 2026 11:04
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