Skip to content

[fix] Use cursor.description to detect result-returning queries#75

Open
jonasbrami wants to merge 1 commit intoapache:masterfrom
jonasbrami:fix-cte-cursor-description
Open

[fix] Use cursor.description to detect result-returning queries#75
jonasbrami wants to merge 1 commit intoapache:masterfrom
jonasbrami:fix-cte-cursor-description

Conversation

@jonasbrami
Copy link

Replace brittle sql_upper.startswith() keyword check with cursor.description, which reliably detects any statement that returns a result set (SELECT, SHOW, DESCRIBE, EXPLAIN, CTEs, etc.) without maintaining a hardcoded list of SQL keywords.

Replace brittle sql_upper.startswith() keyword check with
cursor.description, which reliably detects any statement that
returns a result set (SELECT, SHOW, DESCRIBE, EXPLAIN, CTEs, etc.)
without maintaining a hardcoded list of SQL keywords.
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