mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Better PRAGMA error message, closes #1185
This commit is contained in:
parent
8e8fc5cee5
commit
640ac7071b
3 changed files with 19 additions and 5 deletions
|
|
@ -187,7 +187,9 @@ allowed_pragmas = (
|
|||
disallawed_sql_res = [
|
||||
(
|
||||
re.compile(f"pragma(?!_({'|'.join(allowed_pragmas)}))"),
|
||||
"Statement may not contain PRAGMA",
|
||||
"Statement contained a disallowed PRAGMA. Allowed pragma functions are {}".format(
|
||||
", ".join("pragma_{}()".format(pragma) for pragma in allowed_pragmas)
|
||||
),
|
||||
)
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue