-
-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build HTML version of /content?sql=... #2112
Comments
I changed my mind, I'm not going to do this with a format hook. Also: #2109 (comment) I've decided to let HTML have its own special context. I'm going to try formalizing that as a |
Got Claude to generate this code: from dataclasses import dataclass, field
@dataclass
class QueryContext:
database: str = field(metadata={"help": "The name of the database being queried"})
query: dict = field(metadata={"help": "The SQL query object containing the `sql` string"})
canned_query: str = field(metadata={"help": "The name of the canned query if this is a canned query"})
private: bool = field(metadata={"help": "Boolean indicating if this is a private database"})
urls: dict = field(metadata={"help": "Object containing URL helpers like `database()`"})
canned_write: bool = field(metadata={"help": "Boolean indicating if this canned query allows writes"})
db_is_immutable: bool = field(metadata={"help": "Boolean indicating if this database is immutable"})
error: str = field(metadata={"help": "Any query error message"})
hide_sql: bool = field(metadata={"help": "Boolean indicating if the SQL should be hidden"})
show_hide_link: str = field(metadata={"help": "The URL to toggle showing/hiding the SQL"})
show_hide_text: str = field(metadata={"help": "The text for the show/hide SQL link"})
editable: bool = field(metadata={"help": "Boolean indicating if the SQL can be edited"})
allow_execute_sql: bool = field(metadata={"help": "Boolean indicating if custom SQL can be executed"})
tables: list = field(metadata={"help": "List of table objects in the database"})
named_parameter_values: dict = field(metadata={"help": "Dictionary of parameter names/values"})
csrftoken: callable = field(metadata={"help": "Function to generate a CSRF token"})
edit_sql_url: str = field(metadata={"help": "URL to edit the SQL for a canned query"})
display_rows: list = field(metadata={"help": "List of result rows to display"})
columns: list = field(metadata={"help": "List of column names"})
renderers: dict = field(metadata={"help": "Dictionary of renderer name to URL"})
url_csv: str = field(metadata={"help": "URL for CSV export"})
metadata: dict = field(metadata={"help": "Metadata about the query/database"}) |
Maybe I teach |
This will help make the hook as robust as possible.
The text was updated successfully, but these errors were encountered: