nexusLIMS.tui.apps.db_browser#

Read-only NexusLIMS database browser TUI.

Provides NexusLIMSDBApp, a Textual app that wraps Squall’s SQLiteClientApp to give a stripped-down, read-only view of the database:

  • The “Open Database” button and “Execute SQL” tab are removed.

  • The Table Viewer tab gains a live filter input and click-to-sort column headers, both implemented via parameterised SQL queries so they compose correctly and never expose the database to modification.

Usage#

.. code-block:: python

from argparse import Namespace
from nexusLIMS.tui.apps.db_browser import NexusLIMSDBApp

app = NexusLIMSDBApp(Namespace(filepath="/path/to/nexuslims.db"))
app.run()

Module Contents#

Classes#

NexusLIMSTableViewerPane

Table viewer with live full-text filter and sortable column headers.

NexusLIMSDBApp

Read-only NexusLIMS database browser.

API#

class nexusLIMS.tui.apps.db_browser.NexusLIMSTableViewerPane(db_path: Path, *args, **kwargs)[source]#

Bases: textual.widgets.TabPane

Table viewer with live full-text filter and sortable column headers.

All filtering and sorting is performed via parameterised SQL queries so they compose naturally and the database is never modified.

DEFAULT_CSS = <Multiline-String>#
compose() textual.app.ComposeResult[source]#

Build the table viewer layout.

on_mount() None[source]#

Load the initial table on mount.

class nexusLIMS.tui.apps.db_browser.NexusLIMSDBApp(cli_args: Namespace, *args, **kwargs)[source]#

Bases: squall.squall.SQLiteClientApp

Read-only NexusLIMS database browser.

Extends Squall’s SQLiteClientApp with:

  • The “Open Database” button hidden (path always comes from NX_DB_PATH)

  • The “Execute SQL” tab removed to prevent accidental modifications

  • The Table Viewer replaced with NexusLIMSTableViewerPane, which adds a live filter input and sortable column headers

CSS_PATH#
DEFAULT_CSS#

‘#center { display: none; }’

async update_ui(db_file_path: Path) None[source]#

Load the database into the read-only browser tabs.