Allow leading comments in SQL input field (#653)

Thanks, @jaywgraves!
This commit is contained in:
Jay Graves 2020-02-04 20:13:24 -06:00 committed by GitHub
commit 33a12c8ae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -137,6 +137,8 @@ def test_custom_json_encoder(obj, expected):
"bad_sql",
[
"update blah;",
"-- sql comment to skip\nupdate blah;",
"update blah set some_column='# Hello there\n\n* This is a list\n* of items\n--\n[And a link](https://github.com/simonw/datasette-render-markdown).'\nas demo_markdown",
"PRAGMA case_sensitive_like = true" "SELECT * FROM pragma_index_info('idx52')",
],
)
@ -150,6 +152,8 @@ def test_validate_sql_select_bad(bad_sql):
[
"select count(*) from airports",
"select foo from bar",
"--sql comment to skip\nselect foo from bar",
"select '# Hello there\n\n* This is a list\n* of items\n--\n[And a link](https://github.com/simonw/datasette-render-markdown).'\nas demo_markdown",
"select 1 + 1",
"explain select 1 + 1",
"explain query plan select 1 + 1",