joshtemple / harlequin-bigquery

A BigQuery adapter for Harlequin, a SQL IDE for the terminal.
MIT License
8 stars 2 forks source link

Implement validate_sql #7

Open joshtemple opened 10 months ago

joshtemple commented 10 months ago

Closes #6.

joshtemple commented 10 months ago

@tconbeer would appreciate you taking a look at this WIP. I'm not sure I've done it right. Doesn't the code need to return an error message or anything like that from the database?

tconbeer commented 10 months ago

No, you've got it right. It's kind of un-Pythonic but returning the empty string on error is expected. You'll know it's working if you highlight a valid query and the "Run Query" button says "Run Selection" instead. It should still show "Run Query" if the selected text isn't a valid query.