freesearch module¶
- class FreeSearch(conn=None, label='Frisøk')¶
Bases:
ABCBase class for creating a free-text SQL query interface with results displayed in an AgGrid table.
This class serves as a template for modules that allow users to: - Enter SQL queries in a text area. - Optionally specify partition filters as a dictionary string. - Display query results in an editable Dash AgGrid table.
- Parameters:
label (str)
- abstractmethod layout()¶
Define the layout for the FreeSearch module.
This is an abstract method that must be implemented by subclasses to define the module’s layout.
- Returns:
A Dash HTML Div component representing the layout of the module.
- Return type:
Div
- module_callbacks()¶
Register the Dash callbacks for the FreeSearch module.
This method registers a callback to execute the SQL query when the “kjør” button is clicked. The query results are displayed in the AgGrid table, with appropriate column definitions.
Notes
The callback takes user inputs from the SQL query text area and partition filter input field.
The results are displayed in an editable table, with the “row_id” column hidden by default if present.
- Return type:
None
- class FreeSearchTab(conn=None)¶
Bases:
TabImplementation,FreeSearchImplementation of the FreeSearch module as a tab in the application.
This class extends the FreeSearch base class and provides a layout specific to the tab interface.
- Parameters:
conn (Any | None)
- label: str¶
- module_layout: Div¶
- module_name: str¶
- class FreeSearchWindow(conn=None, **kwargs)¶
Bases:
WindowImplementation,FreeSearchFreeSearchWindow is a class that creates a modal based on the FreeSearch module.
- Parameters:
conn (Any | None)
kwargs (Any)
- label: str¶
- module_layout: Div¶
- module_name: str¶